I have this simple code :
void Application_BeginRequest(object sender, EventArgs e)
{
Trace.Write("Exception Handling", "......");
}
However re-sharper scream (no-error only suggest) about :
Method invocation is skipped. Compiler will not generate method invocation because the method is conditional, or it is a partial method without implementation
I'm not able to see this line in the Trace output.
however - other traces - I do see.
Why is that ?
(p.s. The page (which is under web Site project) has trace="true"
).
Be sure that the TRACE
constant is defined in your project settings for your current build configuration.
UPDATE
Since it's a website project, you could put
#define TRACE
at the top of Global.asax.cs
so that the trace symbol is defined.
To quote the JetBrains wiki (which may* be linked to from the ReSharper menu under 'Why is ReSharper suggesting this'):
While coding, you may encounter warnings regarding methods whose invocations will not be generated by the compiler. Why would that be? Typical cases are conditional methods that will not be compiled (e.g., it’s marked with
[ReSharperInt:Conditional("DEBUG")]
and you’re inRELEASE
mode). Another reason why a method may be skipped is that, at some point, its body has been declared aspartial
and the implementation wasn’t provided.
Given that this is on a method of Trace
, I'd suggest the first of these typical cases is the one that applies.
* I haven't got v7 yet
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With