Do you distribute a product in Release mode?

Last updated by Brook Jeynes [SSW] 8 months ago.See history

We like to have debugging information in our application, so that we can view the line number information in the stack trace. However, we won't release our product in Debug mode, for example if we use "#if Debug" statement in our code we don't want them to be compiled in the release version.

If we want line numbers, we simply need Debugging Information . You can change an option in the project settings so these will be generated in when using Release build.

#if DEBUG MessageBox.Show("Application started"); #endif

Figure: Code that should only run in Debug mode, we certainly don't want this in the release version.

Figure: Set "Generate Debugging Information" to True on the project properties page (VS 2003)

Figure: Set "Debug Info" to "pdb-only" on the Advanced Build Settings page (VS 2005)

We open source. Powered by GitHub