473,513 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting IDE Environment

HI!
Here is my problem: I need to detect when a sub run in Microsoft
Visual Studio IDE, or in an exe stand alone file (deployed!).

With old Visual Basic 6.0 the trick was this:
Private Function RunningIDE() As Boolean
RunningIDE = True
On Error Resume Next
Debug.Print 1 / 0
If Err.Number = 0 Then
RunningIDE = False
End If
On Error GoTo 0
End Function
RunningIDE returns true when my program is in DEBUG mode, in Visual
Studio IDE else returns false!

How can I do the same in Visual studio .NET?????

:(

thx!
:oops:
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
2 1166
"fedrok" <fe****@email-dot-it.no-spam.invalid> schrieb
HI!
Here is my problem: I need to detect when a sub run in Microsoft
Visual Studio IDE, or in an exe stand alone file (deployed!).

With old Visual Basic 6.0 the trick was this:
Private Function RunningIDE() As Boolean
RunningIDE = True
On Error Resume Next
Debug.Print 1 / 0
If Err.Number = 0 Then
RunningIDE = False
End If
On Error GoTo 0
End Function
RunningIDE returns true when my program is in DEBUG mode, in
Visual Studio IDE else returns false!

How can I do the same in Visual studio .NET?????


It runs /always/ in an exe (as a seperate process in opposite to VB6) now.
Maybe you want to find out whether a debugger is attached to the process to
be debugged. Have a look at System.Diagnostics.Debugger.IsAttached.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* fe****@email-dot-it.no-spam.invalid (fedrok) scripsit:
Here is my problem: I need to detect when a sub run in Microsoft
Visual Studio IDE, or in an exe stand alone file (deployed!).


See:

<URL:http://www.google.de/groups?selm=%23O1GIqAOEHA.4036%40TK2MSFTNGP12.phx. gbl>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
14168
by: Daniel Orner | last post by:
Does anyone know of a simple way to have a Python script find out what browser is accessing it? After a web search the only thing I found to do this is Zope, but the system I'm programming doesn't...
5
3501
by: Christoffer Soerensen | last post by:
Hi, I am currently building an application in C# using mono and .NET. I want to get a MIME type for a specific file, which is why I want to detect the OS on which the application is running. On...
1
1562
by: Mark Rae | last post by:
Hi, I'm looking for a reliable way of detecting the version of Windows that the ..NET framework is installed on, specifically the service pack. Currently, I'm using System.Environment.OSVersion...
4
1085
by: Kenneth | last post by:
Hi, I've been written an asp.net Intranet application and since it will run on an intranet it would be good to be able to detect whether the app runs on the same computer that acts as a server...
5
2791
by: segue | last post by:
Hi; I need to detect the window's user's my documents directory and the available space on that drive. I'm trying to do this in vb.net. Segue.
3
2143
by: AdamM | last post by:
How can an app detect whether its running under debug or release mode and update file paths automatically? I have several hardcoded paths like "c:\app\bin\debug" currently and want to make it more...
1
2507
by: Hitesh | last post by:
Hi, I need code in VB.Net to detect if the application is running on Terminal Server. I am using the following code. Please let me know if you see any issues in it or if you have some better code...
6
4621
by: Garry | last post by:
Coming from VB6, I can detect the My Documents and Application Data directories using APIs. Does VB.NET have its own methods to return these values and if so, what are they. The vs.net help...
11
1872
by: BD | last post by:
Hi, all. I'm running 8.2 on Windows. This is a development platform for a project whose production environment is running on a mainframe. I believe that the RI compilation process is not...
13
2834
by: Ilias Lazaridis | last post by:
How to detect memory leaks of python programms, which run in an environment like this: * Suse Linux 9.3 * Apache * mod_python The problem occoured after some updates on the infrastructure....
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.