For some reason, the Debug
class suddenly stopped working for me.
public void WhyDebugIsNotWorking() { Debug.Write("Why am I not working !!!!!!"); }
On the above line, Debug.Write
gets dim (I think Resharper is dimming it) and when I put the cursor on it, it says:
Method invocation is skipped. Compiler will not generate method invocation because the method is conditional, or it is a partial method without implementation.
None of the above conditions are true in my case. As you can see it's a very simple case. I'm not able to use Debug class at all. Please help!
Debug. WriteLine will display in the output window ( Ctrl + Alt + O ), you can also add a TraceListener to the Debug.
WriteLine(String)Writes a message followed by a line terminator to the trace listeners in the Listeners collection. public: static void WriteLine(System::String ^ message); C# Copy. [System.Diagnostics.Conditional("DEBUG")] public static void WriteLine (string message); C# Copy.
To enable or disable Just My Code in Visual Studio, under Tools > Options (or Debug > Options) > Debugging > General, select or deselect Enable Just My Code.
In Visual Studio uppermost menu choose Debug > Windows > Output. It shows all Console. WriteLine("Debug MyVariable: " + MyVariable) when you get to them.
You did not set the DEBUG variable in your build configuration. (there is a checkbox to set "Define DEBUG constant")
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