开发者

TraceInformation method call is disabled by compiler

I put a breakpoint to the last line of code. Breakpoint is disabled. Why? It looks like the code is excluded by some condition. The constructor of TraceSource works, and I can verify the object is OK and all listeners are OK. It really looks bizarre. I stop on int a=1; and then debugger skips TraceInformation by ignoring it. The configuration is DEBUG x86.

public TraceSource _fixTraceSource;

_fixTraceSource = new TraceSource(_configSection.TraceSourceName);

int a = 1; // du开发者_运维百科mmy line to set breakpoint
_fixTraceSource.TraceInformation("FIX -> toAdmin Message: {0}", message.ToString());


TraceInformation is marked:

[Conditional("TRACE")]

So you need the TRACE symbol defined at compile time for it to be included. This is usually by checking the "Define TRACE constant" box in the project properties page (it is enabled by default for both Debug and Release profiles, so somebody has unchecked it at some point).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜