rbulph Posted November 28, 2005 Posted November 28, 2005 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. Quote
Administrators PlausiblyDamp Posted November 28, 2005 Administrators Posted November 28, 2005 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Cags Posted November 28, 2005 Posted November 28, 2005 You can use Conditional Compilation Directives for this I believe. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_2_5_4.asp Quote Anybody looking for a graduate programmer (Midlands, England)?
mskeel Posted November 28, 2005 Posted November 28, 2005 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. Quote
rbulph Posted November 28, 2005 Author Posted November 28, 2005 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? Quote
Administrators PlausiblyDamp Posted November 28, 2005 Administrators Posted November 28, 2005 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
rbulph Posted November 28, 2005 Author Posted November 28, 2005 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. Quote
IngisKahn Posted November 28, 2005 Posted November 28, 2005 The Express version disables it by default. You can turn it on under Tools->Options Quote "Who is John Galt?"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.