If you want to step into the ASP.NET MVC source code you should use MS Public Symbol server for the .PDB files and the ASP.NET MVC source code ( witch should be be extracted in “c:\dd\Mvc\…” because Visual Studio will look there for it ).
But when inspecting variables you will encounter the errors:
“Cannot evaluate expression because the code of the current method is optimized.”
”Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.”
Now you could compile the MVC source yourself without strongly typed name and replace the assembly in your solution or even in the GAC, with all the shortcomings.
But there is an easier method:
Just disable the JIT-compiler’s optimizations by creating a simple .INI file.
Go to the directory where System.Web.Mvc .dll is located:
c:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\
Create the file System.Web.Mvc.ini
[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0
Next time you step into the MVC source code you can inspect all variables.
Leave a Comment