在我尝试显示可视化器的调试会话中第一次,它引发了异常(显示在底部),我在异常消息对话框中单击“继续”并再次显示可视化器(通过单击“放大镜”变量旁边的图标.这是我的简单可视化工具:
[assembly: DebuggerVisualizer(
typeof(TestVisualizer),
Target = typeof (string),
Description = "Test Visualizer")]
namespace VuTree {
public class TestVisualizer : DialogDebuggerVisualizer {
protected override void Show(IDialogVisualizerService svc, IVisualizerObjectProvider provider) {
var text = provider.GetObject() as string ?? "no object found...";
using (var form = new Form())
{
form.Text = text;
form.Size = new Size(400, 400);
svc.ShowDialog(form);
}
}
}
}
这是(部分)例外:
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x8013134F): Object is in a zombie state. (Exception from HRESULT: 0x8013134F)
Server stack trace:
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.IPropertyProxyEESide.InitSourceDataProvider(IEEDataStorage& data)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.SafeProxyWrapper.InitSourceDataProvider()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.SafeProxyWrapper.InitSourceDataProvider()
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy)
为什么会这样?怎么解决?
最佳答案 一般来说,僵尸状态是一个状态,当一个先前启动的线程(由另一个线程)最终完成它的工作,但它没有将控件返回到创建它的调用线程,这意味着它什么也没做,但仍然活着的地方,这就是为什么他们称之为僵尸,因为它应该回来并结束它的生命,但它既没有回来也没有死.到目前为止,这个例外只有在我调试时出现在我面前,我看到它与网络应用程序,桌面,赢取应用程序等等,解决它所需要的只是重新启动应用程序.这将释放所有分配的资源,一切都应该恢复正常.上次我遇到这个异常的时候是我调试了一个在将调试器附加到w3wp.exe进程(app pool)后在IIS中托管的Web应用程序.