The visualizer encountered an internal exception and must be closed
Asked Answered
A

3

6

I use Visual Studio 2022. When I try to use the IEnumerable visualizer, I see this error

The visualizer encountered an internal exception and must be closed

  • I reset all Visual Studio settings, but problem is still here

  • I have not used the "Use Managed Compatibility Mode" option

enter image description here

enter image description here

Analiese answered 16/9, 2023 at 19:48 Comment(1)
same happened with me after updating VS2022 to 17.7.4Memorandum
W
6

This worked for me. Open VS 2022, then go to [Tools] -> [Nuget Package Manager] -> [Package Manager Console]. Run 'Install-Package Newtonsoft.Json' This will install the latest version which matches the version required by VS2022 in my case.

Winnifredwinning answered 27/9, 2023 at 17:48 Comment(1)
yes. this worked!Memorandum
Y
1

While @gregohumber's answer provides a fix, it requires modifying packages for the project in question which may not be viable (or desired). It also strikes me as strange that Visual Studio would interact with the dependencies of one's own project, which seems to be a bug in at least some cases (like here).

I'd recommend the workaround discussed in this SO answer:

  1. While debugging, check the path of the Newtonsoft.Json.dll file being loaded (Debug > Windows > Modules)
  2. Copy the appropriate DLL from the Visual Studio installation directory ([VS Install Path]\Common7\Packages\Debugger\Visualizers\Newtonsoft.Json)
  3. Replace the DLL from your application's build directory with the VS version
Yellowweed answered 23/5 at 19:27 Comment(0)
H
0

If possible, please share a minimalize reproduce sample.

Please make sure the Just My Code is enabled:

enter image description here

and if this issue is caused by the new version of Visual Studio, you could download and install the older version Visual Studio via this:

Release Dates and Build numbers of Visual Studio

Headway answered 19/9, 2023 at 3:27 Comment(2)
This option was active, I have tested in active and inactive mode, but the problem was not solved. After installing Visual Studio 2022, I had to install 2019. When I noticed this problem, I assumed it had something to do with it, so I uninstalled Visual Studio 2019, but it didn't fix the problem. I deleted version 17.7.4 and reinstalled it, but the problem is still there. Therefore, this problem probably appeared after the update and it is better to wait until the next version to fix it.Analiese
@FarzanehTalebi I am sorry, VS2022 old versions are here: learn.microsoft.com/en-us/visualstudio/releases/2022/… You can have a try of the old versions. :)Headway

© 2022 - 2024 — McMap. All rights reserved.