0

编译器失败并显示以下消息:“无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息。”

我知道这与序列化有关(一旦我取消注释带有 [OnSerialized] 标记的方法,构建就会失败。

如何检查 LoaderExceptions?或者更一般地说,我如何捕获和检查 c# 编译器抛出的任何异常?

4

1 回答 1

1

You could try running csc.exe under windbg.exe and inspect the managed exceptions getting thrown. If there's a particular first chance exception that you need to break on, you can issue the sxe <exception> command. Then, load the sos.dll (.loadby sos.dll mscorwks) extension and inspect the exception getting thrown with !pe.

于 2011-03-15T19:57:09.227 回答