I have created a debugger visualizer for a custom class which resides in a c# .net4.5 assembly. When calling GetObject on the IVisualizerObjectProvider, unable to find assembly exception is thrown from the System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() function.
All my classes that are being referenced by CustomClass and the parent class has the [Serializable] attribute. The assembly along with the MoreLinq dependency is placed right alongside the Debugger Visualizer assembly in MyDocuments\Visual Studios 2013\Visualizers folder.
Can anyone give me any pointers?
Thanks,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.DebuggerVisualizers;
[assembly: System.Diagnostics.DebuggerVisualizer(
typeof(CustomClassVisualiser), typeof(VisualizerObjectSource),
Target = typeof(AnotherAssemblyNamespace.CustomClass), Description = "Custom class Visualiser")]
namespace Test
{
using System.Windows;
using Microsoft.VisualStudio.DebuggerVisualizers;
public class CustomClassVisualiser : DialogDebuggerVisualizer
{
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
MessageBox.Show("In");
var objectToVisualise = objectProvider.GetObject();// Failing here!! Unable to find assembly System.Runtime.Serialization.SerializationException
var type = objectToVisualise.GetType();
MessageBox.Show(type.FullName);
MessageBox.Show("");
//window.ShowDialog();
}
}
}