Visual Studio 2019:``本地''错误面板在调试过程中-“内部错误检索本地值" [英] Visual Studio 2019: Error in "locals" panel during debugging - "internal error retrieving local value"

查看:52
本文介绍了Visual Studio 2019:``本地''错误面板在调试过程中-“内部错误检索本地值"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

原始问题

(有关复制说明,请参阅更新II)

我最近在调试会话中搞砸了Visual Studio 2019.我固定了"SqlCommand"类的某些属性,作为收藏夹".从那一刻起,我收到一条错误消息内部错误检索本地值".在本地人"中.

有一个刷新"的提示.值列右侧的按钮,当我点击它时,我收到消息表达式计算器中的内部错误".

现在我无法取消固定该特定属性,因为无法再打开类树.

此行为不受特定解决方案的限制,我创建了一个新的演示解决方案,其中存在完全相同的问题.

您可以在下面的屏幕截图中看到它:

主要目标是通过某种方式清除信息,这些信息将类的哪个属性固定在本地"标签中.窗口.

我已经尝试了几种方法来消除错误.

  • 这表明VS正在以某种方式存储有关标记哪些属性的信息,因此我尝试删除"ComponentModelCache".在AppData中.
  • 我重置了设置.
  • 我在安装程序中使用修复工具.
  • 我删除了* .suo文件,然后删除了整个.vs文件夹.
  • 当我在/safemode中启动devenv时,我看到了相同的问题.
  • devenv/resetuserdata也没有帮助
  • 我检查了活动日志,但是没有任何线索.
  • 我将项目的目标框架从4.7.2更改为3.5

我使用Windows Server 2019 Standard,.Net Framework 4.7.2,Visual Studio 2019 16.7.6

我在演示应用程序中使用以下代码:

  private静态int Main(string [] args){SqlConnection conn =新的SqlConnection();SqlCommand cmd =新的SqlCommand();返回0;} 

UPDATE I

这是我正在谈论的固定功能.我在SqlConnection对象的WorkstationId属性的示例中显示了它(因为在SqlCommand上它不再起作用了).我相信我在命令文本和parameters属性上使用了它.

更新II:复制指令

  1. 全新安装Visual Studio 2019
  2. 创建一个新的控制台项目
  3. 使用我上面在原始问题中发布的代码
  4. 创建Command对象后设置断点
  5. 调试项目[F5]
  6. 打开本地"窗口.
  7. 展开cmd变量并滚动,直到找到"Parameters"为止.财产
  8. 固定参数属性(如更新I中所述)
  9. 停止调试
  10. 再次启动调试器
  11. 打开本地"窗口.
  12. 您看到错误内部错误检索本地值"
  13. 点击刷新"图标(是值"列右侧的圆形箭头)
  14. 您会看到错误表达式计算器中的内部错误".如原始问题中所述.

UPDATE III(更多无济于事的实验)

  • 我使用了修复程序安装"从VS安装程序中下载.
  • 我卸载并重新安装了VS.
  • 我完全删除了整个%USER%/AppData/.../VisualStudio文件夹

解决方案

有一个名为"ObjectFavorites.json"的文件;在文件夹中

%USER%/Documents/Visual Studio 2019/Visualizers

具有以下内容

  {"$ schema":"https://aka.ms/vs/debugger-managed-favorites-schema",类型":{"System.Data.SqlClient.SqlCommand":{收藏夹":[参数"]}}} 

删除"Parameters"行.

您甚至不必停止或重新启动VS,您可以即时编辑此文件.删除该行并且错误消失后,再次启动调试器.

Original Question

(For reproduction instruction see Update II)

I recently messed around with Visual Studio 2019 during a debugging session. I pinned some properties of the class "SqlCommand" as "Favorites". Since that moment I receive an error message "internal error retrieving local value" in the "locals".

There is a "refresh" button on the right of the value column, and when I hit it, I get the message "Internal error in the expression evaluator."

Now I am not able to unpin that specific property, because the class tree can not be opened anymore.

This behavior is not bound to a specific solution, I created a new demo solution where I have the exact same issue.

You can see it in the below screenshot:

The main goal would be to somehow clear the information of which property of the classes are pinned in the "locals" window.

I already tried several things to get rid of the error.

  • It seams that VS is somehow storing the information about which properties are tagged, so I tried to delete the "ComponentModelCache" in the AppData.
  • I reset the settings.
  • I use the repair tool in the installer.
  • I deleted the *.suo file, and then I deleted the whole .vs folder.
  • I see the same issue when i start devenv in /safemode.
  • devenv /resetuserdata did also not help
  • I examined the activity log, but there are no clues.
  • I changed the Target Framework of the project from 4.7.2 to 3.5

I use Windows Server 2019 Standard, .Net Framework 4.7.2, Visual Studio 2019 16.7.6

I use the following code in the demo application:

private static int Main(string[] args)
{
    SqlConnection conn = new SqlConnection();
    SqlCommand cmd = new SqlCommand();

    return 0;
}

UPDATE I

This is the pinning feature i'm talking about. I show it on the example of the WorkstationId property of the SqlConnection object (because it on the SqlCommand it does not work anymore). I believe I used it on the command text and the parameters property. The pinnable property is a relatively new feature introduced with 16.4

UPDATE II: Reproduction instruction

  1. Make a fresh installation of Visual Studio 2019
  2. Create a new console project
  3. Use the code that I posted above in the original question
  4. Set a breakpoint after you created the Command object
  5. Debug the project [F5]
  6. Open the "Locals" window.
  7. Expand the cmd variable and scroll until you find the "Parameters" property
  8. Pin the parameters property (as described in Update I)
  9. Stop debugging
  10. Start the debugger again
  11. Open the "Locals" window.
  12. You see the error "internal error retrieving local value"
  13. Hit the "Refresh" icon (it's the round arrow at the right side of the value column)
  14. You see the error "Internal error in the expression evaluator" as described in the original question.

UPDATE III (More experiments that did not help)

  • I used "fix installation" from the VS installer.
  • I uninstalled and reinstalled VS.
  • I completely deleted the whole %USER%/AppData/.../VisualStudio folder

解决方案

There is a file called "ObjectFavorites.json" in the folder

%USER%/Documents/Visual Studio 2019/Visualizers

It has the following content

{
  "$schema": "https://aka.ms/vs/debugger-managed-favorites-schema",
  "types": {
    "System.Data.SqlClient.SqlCommand": {
      "favorites": [
        "Parameters"
      ]
    }
  }
}

Delete the line "Parameters".

You don't even have to stop or restart VS, you can edit this file on the fly. Start the debugger again after you have removed the line and the error is gone.

这篇关于Visual Studio 2019:``本地''错误面板在调试过程中-“内部错误检索本地值"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆