Hello,
I've got one quick question. Is there any simple way to detect if .net 2.0/3.x winforms application is run from visual studio (in any configuration debug/release/custom) ?
Best regards, Tomasz.
Hello,
I've got one quick question. Is there any simple way to detect if .net 2.0/3.x winforms application is run from visual studio (in any configuration debug/release/custom) ?
Best regards, Tomasz.
I am not entirely sure about this, but I presume that Debugger.IsAttached would be true even in a release configuration.
I'm not sure entirely what you mean. It seems like you could be asking one of the following
For this case, as long as the hosting process is enabled, just look for vshost.exe to be the suffix of the process name.
var isVsDebugLaunched = Process.GetCurrentProcess().ProcessName.EndsWith("vshost.exe")
To accomplish this you will need to look at the parent process for the given process. I'm not sure there is a great way to do that in managed code via the BCL (still looking).