开发者

Find usages not working for code which is not built because of pragma

开发者 https://www.devze.com 2023-03-11 21:09 出处:网络
If I\'m building a debug solution and I have #if !DEBUG public void DoA() { DoB(); } #endif public void DoB()

If I'm building a debug solution and I have

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

public void DoB()
{
}

When I use resharper to do a Find Usages on DoB nothing is found. The purpose of find usages is to find all the usages of a certain method not just those used in a particular build configuration.

Is this something I can disable as it makes refactoring with Resharper less predictive.

Resharper build is: 5.1.3000.开发者_Go百科12


While not 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()
{
}
0

精彩评论

暂无评论...
验证码 换一张
取 消