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
- Make a fresh installation of Visual Studio 2019
- Create a new console project
- Use the code that I posted above in the original question
- Set a breakpoint after you created the Command object
- Debug the project [F5]
- Open the "Locals" window.
- Expand the cmd variable and scroll until you find the "Parameters" property
- Pin the parameters property (as described in Update I)
- Stop debugging
- Start the debugger again
- Open the "Locals" window.
- You see the error "internal error retrieving local value"
- Hit the "Refresh" icon (it's the round arrow at the right side of the value column)
- 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



