Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

Determine running from IDE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jared - 28 Feb 2006 05:14 GMT
Hi,

I would like to write a line of code which will get used in several
debugging points, to look like this..

If app.Mode = IDE then Stop Else End

Or if Stopped ended an EXE mode that would be good.

Application.StartupPath?
Jim Hughes - 28 Feb 2006 05:43 GMT
If DesignMode Then

Else

End If

> Hi,
>
[quoted text clipped - 6 lines]
>
> Application.StartupPath?
Stoitcho Goutsev (100) - 28 Feb 2006 14:23 GMT
That can be discovered only for Component - classes that derive from
Component or classes that implement IComponent. In the latter case this
information can be obtained by the component site (ISite) if set.

Either way you are looking for the DesignMode porperty. This property is
implemented as protected property in the Component class which in turn uses
the DesignMode property of the ISite interface.

For the rest of the types I don't think you can make this discovery.

Signature

HTH
Stoitcho Goutsev (100)

> Hi,
>
[quoted text clipped - 6 lines]
>
> Application.StartupPath?
Patrice - 28 Feb 2006 14:59 GMT
You could perhaps base this on the build mode (debug or release ?) or
depending on wether or not you have a debugger attached rather than just
"running from the IDE" ?

Signature

Patrice

> Hi,
>
[quoted text clipped - 6 lines]
>
> Application.StartupPath?
Herfried K. Wagner [MVP] - 28 Feb 2006 22:08 GMT
"Jared" <jared@paradigmitz.net.au> schrieb:
> I would like to write a line of code which will get used in several
> debugging points, to look like this..
>
> If app.Mode = IDE then Stop Else End

Maybe the following solutions fit your requirements:

\\\
#If DEBUG Then
   Console.WriteLine("Debug mode.")
#Else
   Console.WriteLine("Release mode.")
#End If
///

Make sure that the option "Configuration settings" -> "Build" "Define DEBUG
constant" in the project properties is checked.

- and/or -

You can check if a debugger is attached:
'System.Diagnostics.Debugger.IsAttached'.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

Jared - 28 Feb 2006 23:25 GMT
Closest to a solution, but would like something that would work even if i
gave client a debug version.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.