In our Windows Application, some times we may need to check whether our application is running in IDE or is running as EXE. A typical example would be, we might use Development Server while working in development/debug mode. Once the application is deployed we will be using Live Server. It is very hard if you keep on chaning the server names each time like while dev change the server to development and while live change it back to live. We might make mistakes while switching these servers. To avoid these difficulties we can use the following function to see whether our application is running in IDE or running as standalone EXE.
Module modMain
Sub Main()
If IsApplicationRunningInIDE() Then
Console.WriteLine("I am working on IDE")
Else
Console.WriteLine("I am working on standalone EXE")
End If
End Sub
Public Function IsApplicationRunningInIDE() As Boolean
Return System.Diagnostics.Debugger.IsAttached()
End Function
End ModuleProject Type: Console
Language: VB.Net
Tested with: VS 2008
Incoming search terms:
- c# check if running in ide
- net determine if running from ide
- net detect if running in ide
- how to tell if a program is running in ide
- how to know using code application is running on deploy mode vb net
- how to find out if application is running in ide
- dot net determine if running in ide
- determine is ide c#
- determine if c# application is running in development environment
- detect when running ide c#
