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

使用手表时,出现以下错误消息:

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.

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

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

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

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

编辑:

代码发生的地方:

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

            return null;
        }

我只是想看看t

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

参考方案

在VS 2015社区版中

转到调试->选项或工具->选项

并检查Debugging-> General-> Suppress JIT Optimization on module load(仅托管)

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

Visual Studio 2012不会让我调试接口的实现 - c#

我正在LINQ中进行一些查询,想了解它的实现,所以我想到了调试的方法,但是当我尝试这样做时,Visual Studio没有进入接口的实现,不知道为什么会这样。我正在使用Visual Studio Community2015。这是我的代码class Client { static void Main(string[] args) { string[] word…

Visual Studio Cant查找文件-调试 - c#

在Visual Studio 2015中进行调试期间,无法找到文件:xxxx.cs not found You need to find xxx.cs to view the source for the current call stack frame Try one of the following options: - Browse and find …

为什么在Visual Studio 2010中未达到断点? - c#

static void Main(string[] args) { List<int> li = new List<int>() { 1, 20, 30, 4, 5 }; GetNosLessThan5(li); } public static IEnumerable<int> GetNosLessThan5(List&l…

在Visual Studio 2017上安装Monogame - c#

我正在尝试在VS 2017上安装Monogame,但是即使我已安装VS 2017,VS 2017安装程序上的选项也会显示为灰色。我也有VS 2015和VS 2010,但是我不确定是否是引起问题的。 MonoGame的版本为3.6.0.1625,我当前具有以下目录:C:\ Users \ MY NAME \ Documents \ Visual Studio …

Visual Studio Code可以增量编译Java Web App项目吗? - java

我是Visual Studio Code的新手。我正在尝试将其与使用Maven的现有Java Web应用程序项目一起使用。我已经下载了推荐的Java扩展,例如Java Extension Pack,Java Maven和Java Tomcat。在IntelliJ(我通常的IDE)中,我可以很快地从Java的少量编辑转到Tomcat中刷新的WAR。如果我编辑文…