调试器可视化工具和“类型未标记为可序列化”
我正在尝试创建一个调试器可视化工具,它将显示任何Control
的控制层次结构。它已完成,但我收到异常“类型未标记为可序列化”。
我该如何克服这个问题?控件是.NET Windows Forms框架类型,我无法将其标记为可序列化。
I am trying to create a debugger visualizer that would show control hierarchy for any Control
. It's done but I'm getting the exception "Type is not marked as serializable".
How do I overcome that? Control is a .NET Windows Forms framework type, I can't mark it as serializable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还需要实现 VisualizerObjectSource 执行自定义序列化。
示例:
您还需要使用适当的 VisualizarObjectSource 注册可视化工具,在本示例中可能如下所示:
You'll need to also implement a VisualizerObjectSource to perform custom serialization.
Example:
You'll also need to register the visualizer with the appropriated
VisualizarObjectSource
, which for this example could be something like this: