【问题标题】:Visual Studio 2015 intellisense not appearing during debug调试期间未出现 Visual Studio 2015 智能感知
【发布时间】:2016-07-27 10:06:50
【问题描述】:

当我使用手表时,我收到以下错误消息:

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

这真的很奇怪,因为我只能在应用程序的某些部分获得智能感知。这个问题最初是在我无法进入我的方法时开始的,所以通过搜索。我在调试器中关闭了仅我的代码选项。

到目前为止我已经尝试过:

  1. 重启机器
  2. 清理 + 重建 VS2015
  3. 我已关闭所有调试优化

我不知道该怎么做。有人可以帮忙吗?

编辑:

发生的代码:

 public IList<string> PopulateFilterList(string selectedFields) {
            IList<string> ExcludedFields = _homeRepository.GetExcludedFields();
            Type t = typeof(Invoice);

            return null;
        }

我只是想看看t

编辑:如果我在调试器中选中“在模块加载时抑制 JIT 优化”选项,我会得到智能感知。我得到了智能感知

【问题讨论】:

  • 您已关闭所有调试优化,但您是否处于调试解决方案配置中?
  • 你能展示一些发生行为的代码吗?
  • 我几乎不记得曾经发生过类似的事情,但我认为它已经通过干净 + 重建解决了。无论如何尝试删除 /bin 和 /obj 内容,看看是否有帮助

标签: c# visual-studio-2015 visual-studio-debugging


【解决方案1】:

在 VS 2015 社区版中

进入调试->选项或工具->选项

并检查 Debugging->General->Suppress JIT optimization on module load (Managed only)

如果这不起作用,请检查解决方案中的所有项目是否在项目属性中未勾选“优化代码”选项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-25
    • 2018-02-06
    • 2016-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-26
    • 2015-07-02
    相关资源
    最近更新 更多