views:

89

answers:

1

Does anyone have any advice about extending our SVN & Cruise Control CI process to populate a Symbol Server?

We are trying to remotely debug test environments for our ASP.NET 2.0 C# website and have been running into problems getting the correct symbols to always load.

Our build process is done in release mode not debug mode so how does this affect the creation of PDB files?

Using VS2008, we have solved several issues in connecting to remote debugging since the test environments are not in the same domain. We are now getting this message when trying to watch variables:

Cannot obtain value of local or argument 'xxxxx' as it is not available at this instruction pointer, possibly because it has been optimized away

Is this because our build and subsequent deployment process is in release mode?

A: 

This error message comes because the CLR itself has optimized out the variables. The PDB's still contain all of the information about the locals in release mode, the debugger is just simply unable to access them.

It is possible though to build in release mode and generally avoid this problem. One of the factors as to whether or not the CLR will optimize in such a way that locals are not visible is the DebuggableAttribute class.

This attribute is generally emitted by the compiler and it changes the flags based on the projects mode: Release or Debug. If the attribute already exists in your project though, the compiler will not overwrite it.

If your have a web application (vs a web site) you can just add the following line to AssemblyInfo.cs and it should fix the problem

[assembly: Debuggable(DebuggingModes.DisableOptimizations)]

Note this does disable performance optimizations so you probably don't want to actually release this way but it's helpful for debugging.

JaredPar
Thanks, just the pointer I needed, have actually adjusted our CI process to disable optimization for all assemblies with the correct switch for msbuild.exe.
Dave Anderson