调试.NET code与MS的符号服务器 - VS不显示变量的值变量、符号、服务器、code

2023-09-03 08:53:58 作者:姓大、名爷

当我调试使用Microsoft调试符号对.NET ..我不断收到这个傻'结果'的大部分变量的时候,我调试.NET框架$ C $我的ASP.NET web站点code C(这当然是由微软符号服务器,这令我跟VS2008抢信息,从提供)

When I debug my ASP.NET web site code using the Microsoft debug symbol's for .NET .. I keep getting this silly 'result' for most of the variables when I'm debugging .NET framework code (which of course is provided by the Microsoft Symbol Server, which I told VS2008 to grab the info, from)

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

这就像code我使用的是使用了优化,编译code。如果是这样的话,我可以告诉它不要优化?我在调试配置。这是非常令人沮丧,因为我不能调试..因为我看不到/检索局部变量的值,因为我通过code步骤。

It's like the code I'm using is using optimized, compiled code. If that's the case, can I tell it NOT to optimize? I'm in DEBUG configuration. It's very frustrating because I cannot debug .. cause I can't see/retrieve the values of local variables as I step through the code.

任何线索/想法?

推荐答案

肖恩·伯克描述禁用此方法他的blog.

Shawn Burke described a method of disabling this on his blog.

首先,创建一个CMD那会加载Visual Studio中没有JIT优化。

First, create a CMD that'll load Visual Studio without JIT optimization.

set COMPLUS_ZapDisable=1
cd /d "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\ide\"
start devenv.exe
exit

在您的Visual Studio项目,请执行下列操作步骤:

Once in your Visual Studio project, do the following steps:

1),右键点击你的项目文件,并选择属性

1) Right click on your project file and choose "Properties"

2)选择调试选项卡,取消启用在Visual Studio宿主进程

2) Choose the "Debug" tab and uncheck "Enable the Visual Studio Hosting Process"

3)在调试器中启动应用程序。

3) Launch your application in the debugger.