Since VS 2005, the default settings for BOTH Release builds and Debug builds of your assemblies allow the run-time to attach a debugger.
The default Release build attaches the following attribute to your assembly:
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Igno reSymbolStoreSequencePoints)]
The default Debug build attaches:
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Disa bleOptimizations | DebuggableAttribute.DebuggingModes.EnableEditAndCo ntinue | DebuggableAttribute.DebuggingModes.IgnoreSymbolSto reSequencePoints | DebuggableAttribute.DebuggingModes.Default)]
The run-time can attach a debugger to assembiles running in either of these debugging modes.
If you want an assembly that the run-time canât attach a debugger to, right click your project file and select properties, click the Build tab, then the Advanced button. In the Advanced Build Settings dialog under Output --> Debug Info, select âNoneâ. This will generate an assembly with no DebuggableAttribute, and a debugger wonât be able to attach to it. The VS default setting for Debug builds is âfullâ, and the default setting for Release builds is âpdb-onlyâ. Generally, you will want to hold on to .pdb files for your Release builds too, though. Hence the default. No one will be able to step into your class libraries anyway unless they can first step into a source code file that references them. But you being able to step into your class libraries when working with your own source code is a good thing.
HTH,
Bob
|