I need to detect if my application is running under the Visual Studio IDE (2005, 2008 and 2010).
The reason is that I distribute developer licenses of my DLL, so I need detect if the DLL is running under VS to check that the license exists.
Currently, I’m using the System.Diagnostics.Debugger.IsAttached property and checking if the parent process of my application is devenv.exe. So far this works okay.
I’m wondering if this is the proper way, or am I missing something?
I’ve seen MSDN examples use that, and I’m unaware of any other way to check, so I would say that you are doing it correctly.