hi
What is the best way in c# to determine whether the programmer is running the program via IDE or it's user?
hi
What is the best way in c# to determine whether the programmer is running the program via IDE or it's user?
public static bool IsInVisualStudio
{
get
{
bool inIDE = false;
string[] args = System.Environment.GetCommandLineArgs();
if (args != null && args.Length > 0)
{
string prgName = args[0].ToUpper();
inIDE = prgName.EndsWith("VSHOST.EXE");
}
return inIDE;
}
}
if (System.Diagnostics.Debugger.IsAttached) {
// You are debugging
}