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# determine application is running in ide
- test if in ide vb net
- running ide vb net
- net detect if running in ide
- how to tell if vb net application is running in ide
- how to tell if program is running in ide c#
- how to know using code application is running on deploy mode vb net
- how to find out if application is running in ide
- dotnet c# check if application is running
- determine is ide c#