Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
How do you determine within an application whether it is running in the development environment or an exe? In VB 6.0 I always did it by using a Debug.Assert statement, but I imagine there is a simpler way in .net.
  • Administrators
Posted

Under .Net you are always running as an exe regardless of how the application was launched.

However you can always check System.Diagnostics.Debugger.IsAttached to see if a managed debugger is attached to the process.

Another thing to be aware of is the difference between Debug and Release builds of software and how that can affect run-time behaviour.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Conditional Compilation will only tell you whether you compiled with the debug=true flag and thus have debugging symbols or not. You can still attach a debugger to a process that doesn't have dubugging symbols. You'll only get a call stack and assembly (maybe IL in this case?), but you can still attach a debugger.
Posted
Under .Net you are always running as an exe regardless of how the application was launched.

However you can always check System.Diagnostics.Debugger.IsAttached to see if a managed debugger is attached to the process.

Another thing to be aware of is the difference between Debug and Release builds of software and how that can affect run-time behaviour.

OK, so the Debug build is built every time you run (debug) the application in the development environment and is then run. It's a bit bigger and a bit slower than the Release build. The Release build is built when you select Build from the menu in the development environment. Fine.

 

Why do these two exes and associated files get duplicated in the solution directory, in that they appear under both a "bin" and an "obj" directory?

  • Administrators
Posted

The type of output is decided by the dropdown on the toolbar - Debug and Release being the default.

The bin directory is the final output of the build process, the obj directory is a tempory location that the files are generated in during the build process.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
The type of output is decided by the dropdown on the toolbar - Debug and Release being the default.

The bin directory is the final output of the build process, the obj directory is a tempory location that the files are generated in during the build process.

OK, will ignore the obj Directory. Can't see any such dropdown (am using 2005 version - see screenshot). The second toolbar showing in the screenshot is the Build toolbar, but it just allows you to build the release exe for the solution or al exes and dlls for the current project, not any debug exes/dlls.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...