Rule #29
Do you distribute a product in Release mode?
  v5.0 Posted at 20/10/2010 7:56 PM by system
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.
Debug configuration
Figure: Set "Generate Debugging Information" to True on the project properties page (VS 2003).
Advanced Build Settings
Figure: Set "Debug Info" to "pdb-only" on the Advanced Build Settings page (VS 2005).
We have a program called SSW Code Auditor to check for this rule.
 


Related rules