VSExtensibility: Could not load file or assembly 'Newtonsoft.Json...'

I’m playing around with creating a new visualizer and copied most of the code from this sample: https://github.com/microsoft/VSExtensibility/tree/main/New_Extensibility_Model/Samples/RegexMatchDebugVisualizer

When running my code, I get the following error inside my custom XAML view:

image

I was under the impression that VS automatically loads Newtonsoft.Json used in this call:

ExceptionModel targetObjectValue = await visualizerTarget.ObjectSource.RequestDataAsync<ExceptionModel>(jsonSerializer: null, cancellationToken);

It doesn’t help to install that package manually.

What could be the issue here?

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Hello @ThomasArdal, the issue has been fixed and is currently available in VS 17.8 Preview 3. More information can be found in the related VS developer community ticket.

Hello, a few questions:

  1. are you able to use the unmodified RegexMatchDebugVisualizer?
  2. Which version of Visual Studio are you using? And which version of the Microsoft.VisualStudio.Extensibility.Sdk are you using?
  3. Which edition of Visual Studio are you using? (Community, Professional, Enterprise)
  4. If you put a breakpoint on the RequestDataAsync call, does the breakpoint get hit? In other words, does everything work fine until before the RequestDataAsync call?
  5. In your object source project, what package reference do you have? Which version of Microsoft.VisualStudio.DebuggerVisualizers? Did you add an explicit reference to Newtonsoft.Json or to some other package?

If you want to share your project (make sure not to include any code or information that you wouldn’t want to be visible to the public), I would be happy to check it out. Thanks!