I have an application developed on VB.NET2010 and I need to enable some objects only when is in debug mode.
The application can know when is being debugged?
I have an application developed on VB.NET2010 and I need to enable some objects only when is in debug mode.
The application can know when is being debugged?
you can try to add these preprocessor lines in your script!
#If DEBUG Then
Console.WriteLine("Debug mode.")
#Else
Console.WriteLine("Release mode.")
#End If
You will get the result as per conditions.
Example:
if (Debugger.IsAttached)
{
....
}
(Debugger belongs to the System.Diagnostics namespace)