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.
当前回答
转到“项目属性”,在“构建”下确保“优化代码”复选框未选中。
此外,在高级选项(在构建选项卡下)中将“调试信息”下拉菜单设置为“完全”。
其他回答
在visual Studio 2017中 去调试->选项,然后检查调试->通用-> 选中这个选项
我也遇到过同样的问题,我的解决方案是将解决方案配置从发布更改为调试。希望能有所帮助
对于web应用程序,还有一个重要的问题,那就是在应用程序发布过程中选择正确的配置。
你可以在调试模式下构建你的应用,但它可能发生在你以发布模式发布它,默认情况下优化代码,但IDE可能会误导你,因为它显示调试模式,而发布的代码是在发布模式。 你可以在下面的快照中看到详细信息:
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.
我只是碰到这个问题,我在发布构建配置下运行,而不是调试构建配置下运行。一旦我切换回调试我的变量显示在手表再次。