我爲駐留在c#.net4.5程序集中的自定義類創建了調試器可視化程序。在IVisualizerObjectProvider上調用GetObject時,無法從System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()函數中找到程序集異常。IVisualizerObjectProvider GetObject拋出程序集未找到異常
我所有被CustomClass和父類引用的類都有[Serializable]屬性。該程序集與MoreLinq依賴項一起放置在MyDocuments \ Visual Studios 2013 \ Visualizers文件夾中的Debugger Visualizer程序集旁邊。
任何人都可以給我任何指針?
感謝,
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();
}
}
}