VS2012不会因新项目的例外而中断

时间:2022-10-18 20:53:39

I added a new console application project to my VS2012 solution.

我在VS2012解决方案中添加了一个新的控制台应用程序项目。

When it encounters an exception, I get an error dialog, and VS2012 does not break and go to the source line that threw the exception.

当遇到异常时,我得到一个错误对话框,VS2012不会中断并转到引发异常的源代码行。

The original project that was created together with the Solution does break on exceptions properly, so I think the issue is that the newly created executable is not marked as relevant for breaking on exceptions. (The debugger is "not attached"? I'm not sure if this is the right term)

与解决方案一起创建的原始项目确实正确地中断了异常,因此我认为问题在于新创建的可执行文件未标记为打破异常的相关性。 (调试器“未附加”?我不确定这是否是正确的术语)

How can I make VS2012 start breaking on exception in a project?

如何让VS2012开始打破项目中的异常?

I am using the Debug configuration, the pdb is being generated.

我正在使用Debug配置,正在生成pdb。

1 个解决方案

#1


3  

There is an issue with recent x64 Windows systems when they do not propagate exception properly back to the x64 application when function calls cross kernel boundaries. There are plenty of posts here on SO and all over the internet about it, for example the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64

最近的x64 Windows系统在函数调用跨越内核边界时没有正确地将异常传播回x64应用程序时出现问题。这里有大量关于它的帖子以及关于它的所有关于它的帖子,例如 - 消失的onload-exception-user-mode-callback-exceptions-in-x64

You can fight it to some extent by going to Debug->Exceptions and flagging CLR exceptions Thrown column. But note that then VS would break even on the exceptions handled by you.

您可以通过转到Debug-> Exceptions并标记CLR异常Thrown列来在某种程度上对抗它。但请注意,VS会对您处理的异常进行收支平衡。

#1


3  

There is an issue with recent x64 Windows systems when they do not propagate exception properly back to the x64 application when function calls cross kernel boundaries. There are plenty of posts here on SO and all over the internet about it, for example the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64

最近的x64 Windows系统在函数调用跨越内核边界时没有正确地将异常传播回x64应用程序时出现问题。这里有大量关于它的帖子以及关于它的所有关于它的帖子,例如 - 消失的onload-exception-user-mode-callback-exceptions-in-x64

You can fight it to some extent by going to Debug->Exceptions and flagging CLR exceptions Thrown column. But note that then VS would break even on the exceptions handled by you.

您可以通过转到Debug-> Exceptions并标记CLR异常Thrown列来在某种程度上对抗它。但请注意,VS会对您处理的异常进行收支平衡。