Visual Studio 2010在不安全块中杀死函数的一个参数中的数据(没有其他词)。 是什么导致了这个错误?调试器显示以下消息。
Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away.
Visual Studio 2010在不安全块中杀死函数的一个参数中的数据(没有其他词)。 是什么导致了这个错误?调试器显示以下消息。
Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away.
当前回答
转到“项目属性”,在“构建”下确保“优化代码”复选框未选中。
此外,在高级选项(在构建选项卡下)中将“调试信息”下拉菜单设置为“完全”。
其他回答
I found that I had the same problem when I was running a project and debugging by attaching to an IIS process. I also was running in Debug mode with optimizations turned off. While I thought the code compiled fine, when I detached and tried to compile, one of the references was not found. This was due to another developer here that made modifications and changed the location of the reference. The reference did not show up with the alert symbol, so I thought everything was fine until I did the compilation. Once fixing the reference and running again it worked.
我也遇到过同样的问题,我的解决方案是将解决方案配置从发布更改为调试。希望能有所帮助
转到“项目属性”,在“构建”下确保“优化代码”复选框未选中。
此外,在高级选项(在构建选项卡下)中将“调试信息”下拉菜单设置为“完全”。
以我为例,我正在开发一个web api项目,尽管该项目被正确地设置为完全调试,但每当我连接到我试图调试的IIS进程时,我仍然会看到这个错误。然后我意识到发布概要文件被设置为使用发布配置。所以,如果你正在使用dotnet web api项目的“发布”功能,还有一个地方要检查你的发布配置文件。
在Visual Studio 2017或2015中:
转到解决方案,右键单击解决方案,然后选择属性->选择所有配置->调试,然后单击确定。 在“重新构建并运行”之后,这个解决方案对我来说是有效的。