Usage search does not work for code that is not built due to pragma

If I create a debugging solution and I have

#if !DEBUG public void DoA() { DoB(); } #endif public void DoB() { } 

When I use resharper to do Find Usages in DoB, nothing was found. The purpose of the search is to find all ways to use a particular method, and not just those that are used in a specific assembly configuration.

This is something I can turn off, since refactoring with Resharper is less predictive.

Resharper build: 5.1.3000.12

+4
source share
1 answer

Without strictly answering your question, a potential workaround (which may or may not be practical for you) would be to use Conditional attributes instead of #if directives:

 [Conditional("DEBUG")] public void DoA() { DoB(); } public void DoB() { } 
+5
source

All Articles