Visual Studio custom debugger visualizer cannot load dependency

2.5k Views Asked by At

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!

1

There are 1 best solutions below

3
On BEST ANSWER

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.