简体   繁体   English

在调试过程中未出现Visual Studio 2015智能感知

[英]Visual Studio 2015 intellisense not appearing during debug

When I use a watch I get this error message: 当我使用手表时,出现以下错误信息:

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.

It's really strange because I can only get intellisense in some parts of the application. 真的很奇怪,因为我只能在应用程序的某些部分获得智能感知。 The issue originally started when I couldn't step into my methods, so through searching. 该问题最初是在我无法进入方法时开始的,因此是通过搜索。 I turned off the just my code option in the debugger. 我在调试器中关闭了我的代码选项。

So far I have tried: 到目前为止,我已经尝试过:

  1. Restart machine 重启机器
  2. Clean + Rebuild VS2015 清理+重建VS2015
  3. I have turned off all optimisations for debugging 我已关闭所有调试优化

I have no idea what to do. 我不知道该怎么做。 Can anyone help? 有人可以帮忙吗?

EDIT: 编辑:

Code where it happens: 代码发生的地方:

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

            return null;
        }

I'm just trying to look at t 我只是想看看t

Edit: If I check the option 'Suppress JIT optimisation on module load' in the debugger I get intellisense. 编辑:如果我在调试器中选中“在模块加载时抑制JIT优化”选项,则会得到智能感知。 I get intellisense 我懂了

In VS 2015 Community Edition 在VS 2015社区版中

go to Debug->Options or Tools->Options 转到调试->选项或工具->选项

and check Debugging->General->Suppress JIT optimization on module load (Managed only) 并检查“调试”->“常规”->“抑制模块加载时的JIT优化(仅托管)”

if this doesn't work check that all projects in the solution have the option "Optimize code" un-ticked in the project properties. 如果这样不起作用,请检查解决方案中的所有项目是否在项目属性中均未选中“优化代码”选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM