You can tell Visual Studio to run your application with a special command
line argument. Click Project -Properties -Debug and enter "/debug" as an
argument. Use the following if-statement in your program to detect if it was
started from Visual Studio:
string[] args = Environment.GetCommandLineArgs(); // remove this line if
your program is a console application
if (args.Length 0 && args[0] == "/debug")
// started from VS
else
// not started from VS
I'm sure there are more elegant solutions but this is one of the easiest.
"bz" <bz*****@gmail.comschrieb im Newsbeitrag
news:fc**********************************@e1g2000h sh.googlegroups.com...
Hi,
I need to detect at runtime if the application was started from VS
2005. Is it possible?
Also, how can I know at runtime of app is built for Debug or Release?
Thanks