0

I created a class library with some custom debugger visualizers -- simple things like viewing a System.Drawing.Image or creating a swatch for System.Drawing.Color. Now I am trying to add a visualizer for a class that depends on an assembly reference (Aspose.Cells in case anyone is wondering). When I attempt to use this visualizer, I get the following exception:

Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 11.\Common7\Packages\Debugger\Visualizers\MyCustomVisualizers.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

The other visualizers (such as for System.Drawing.Image) work fine.

How do you suggest I solve this problem?

Thanks in advance!

  • I get weird errors like that with Visual Studio 2012 from time to time... I just shut it down and power it back up again and things work. I'd be interested in a better solution though – Mikey Mouse Jan 08 '14 at 17:38

1 Answers1

0

This is the key problem

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Visual Studio 2012 uses .Net 4.5.0. This assembly was most likely built in Visual Studio 2013 which uses 4.5.1. In order to make this work you're going to need to recompile the Visualizer for 4.5.

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
  • I retargeted my visualizers assembly (it was 4.5) to match the web application and class libraries I am debugging, so they are all targetting 3.5 now. However, I get the same exception. – John Reiner Jan 08 '14 at 17:56
  • @JohnReiner one of those assemblies or their dependency is still targeting a diff framework version. That's the only reason that messag ewould be displayed. Have you tried using fuslogvw to look at the actual failure? It should have a much more instructive message – JaredPar Jan 08 '14 at 17:58
  • I closed all instances of Visual Studio, reset IIS, and now the assembly is loading. Thanks! – John Reiner Jan 08 '14 at 18:47