简体   繁体   English

GUI 线程中的异常导致 vshost.exe 崩溃

[英]Exception in GUI thread causing vshost.exe to crash

I think my Visual Studio 2008 (.net 3.5) is corrupted.我认为我的 Visual Studio 2008 (.net 3.5) 已损坏。

If I start a new Windows Forms project in a new solution, add the code如果我在新的解决方案中启动一个新的 Windows Forms 项目,添加代码

double[] x = new double[2];
x[3] = -1.0;

to the form_load handler (or a button handler), and try to debug the program, it crashes immediately, not throwing an exception, but actually crashing.到 form_load 处理程序(或按钮处理程序),并尝试调试程序,它立即崩溃,不是抛出异常,而是实际崩溃。

If I put the same code in the form constructor or in Main, an exception gets thrown like normal.如果我将相同的代码放在表单构造函数或 Main 中,则会像往常一样抛出异常。

Any ideas what might be going on?任何想法可能会发生什么?

Don't worry, your VS is fine.别担心,你的VS很好。

The form load handler will (ultimately) be invoked from the Windows message loop, where exception handling is a little different.表单加载处理程序将(最终)从 Windows 消息循环中调用,其中异常处理略有不同。 See here for more details.有关更多详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM