Doesn't seems to be easy. I have struggled my mind for 2 weeks now (trying to convert my VB6 snippet to .Net but wasn't able to do it!).
But tonight, I found something:
The IDE acts as a debugger, so you could use:
System.Diagnostics.Debugger.IsAttachedhttp://www.dotnet247.com/247reference/msgs/30/151468.aspx>What is the best method to determine if you are running from the IDE?
>
>Eric Moreau had the best method that I had found in VB6. I was hoping for a framework answer. I have looked through the books I have and have drawn a major blank.
>
>My thanks in advance,
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com