0

I have .NET application that sometimes happily catches System.OutOfMemory (of unknown origin). I tried to debug it by attaching visual studio to it, but when exception happened, visual studio was unable to show me any stack trace. How can I get the stack trace?

4

1 回答 1

0

您应该尝试使用 try-catch 包装任何可能导致异常的代码,然后在每个 try catch 的 catch 语句上放置一个断点。因此,当您将 VS 附加到它时,您将能够在触发断点时分析异常。

如果您有一个 Main 方法,则将所有代码包装在一个 try-catch 中,这可能允许您捕获任何可能引发的异常。

于 2012-11-17T08:39:47.407 回答