Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors using extension in VS2022 #8

Open
Zarepheth opened this issue Nov 19, 2024 · 1 comment
Open

Errors using extension in VS2022 #8

Zarepheth opened this issue Nov 19, 2024 · 1 comment

Comments

@Zarepheth
Copy link

Visual Studio 2022 version 17.11.5
This extension, v4.0.0.0, was installed via the VS extension manager.

Error:

Unable to load the custom visualizer.

Unable to load the custom visualizer.
The debuggee-side visualizer assembly 'KGySoft.Drawing.DebuggerVisualizers.GdiPlus, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b45eba277439ddfe' was not found at path 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Packages\Debugger\Visualizers
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Packages\Debugger\Visualizers\Newtonsoft.Json\netstandard2.0'.

This error occurred the 2nd time I used the visualizer. The first time, with a System.Drawing.Image variable, it worked fine. The second attempt was with a System.Drawing.Bitmap variable. After the failure, it continued failing even when trying to view the variable it was able to display on the first attempt.

Just a guess, but I think the installer is putting the pieces of the debugger in the wrong places - or perhaps they are receiving the wrong paths.

Workaround:

After reviewing information in this GitHub repository, I downloaded the binaries directly from here, then copied the content of the net462 directory, directly into that first path of the error message. After doing so, the visualizer resumed working. And did so while retaining the active debugging session.

@koszeggy
Copy link
Owner

This is unfortunately a VS thing (admittedly, a really annoying one), and it happens sporadically. It's mentioned also in the Troubleshooting section.

The fact that it worked for an Image first but then failed for a Bitmap indicates that it's not the visualizer's issue: if the actual type of the Image is Bitmap (rather than a Metafile), then exactly the same view must appear.

After the failure, it continued failing even when trying to view the variable it was able to display on the first attempt.

Yes, when this happens, the debugger stops working properly until you change the current statement, i.e. pressing F10 (maybe followed by a Set next statement to reset the previous stage if required) fixes the debugger.

Unfortunately VS is not open source, so I can't debug it and create pull requests for them, and it's really hard to make them fix such bugs. They often just close the reported issues as 'low priority'.

I'm pretty sure your workaround didn't affect the issue. It's working again because you restarted the debug session, but it may randomly occur again. But of course, if you can create a reproducible example, don't hesitate to report it, and I'll investigate. One little thing that makes me a bit unsure though is the Newtonsoft.Json in the reported path, which is quite strange. A .NET Core+ project requires the visualizers in the %Documents%\Visual Studio 2022\Visualizers\netstandard2.0 folder, whereas a .NET Framework one loads them from its the parent folder. The extension should install the visualizers into these two folders. Anyhow, even if this is related to the issue somehow, then the visualizer shouldn't have worked for the 1st time when the debugger successfully opened for the Image variable.

To say something positive and hopeful, too: Actually I plan to migrate to the newer visualizer infrastructure - at least if the extension is installed to a VS version that supports it (the one that is used also by the built-in enumerable visualizer), which hopefully has a better support than the legacy way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants