When using the PDB to debug XAF, it is found that many variables are not visible. All are optimized.
The following methods can be resolved.
When you debug. Net source code using reference source functionality in VS 2008, you will find that many variables cannot be viewed while debugging.
This is because the code provided on the source-code server is optimized for final sales by default (optimized). These values, although you cannot view them, do not block stepping, and in most cases you may not need to see them.
But if you really need to see it, there's still a way to do it.
You need to sue the CLR not to load Pre-jit (also add NGen) mirroring. Here are the specific steps:
First, create a cmd file. The file contains a few steps, set an environment variable, and then start Visual Studio. I name this file "Nooptdevenv.cmd", the specific content is as follows:
Set complus_zapdisable=1
cd/d "%ProgramFiles%\Microsoft Visual Studio 9.0\common7\ide\"
Start devenv.exe
Exit
I put this cmd file on my desktop and use this file to start vs when I need to disable optimization (optimizations).
Once Visual Studio starts, the following steps are required:
- Right-click your project file and select Properties
- Select Debug (Debug), uncheck "Allow Visual Studio managed processes (enable the Visual Studio Hosting process)"
- Start your program in debug mode.
Now you can see the values of all the local and member variables:
Original: Http://blogs.msdn.com/b/sburke/archive/2008/01/29/how-to-disable-optimizations-when-debugging-reference-source.aspx
How to cancel optimizations (code optimization) when debugging. Net source code using reference source-translation