开发者

Exception in GUI thread causing vshost.exe to crash

开发者 https://www.devze.com 2023-03-17 05:45 出处:网络
I think my Visual Studio 2008 (.net 3.5) is corrupted. If I start a new Windows Forms project in a new solution, add the co开发者_C百科de

I think my Visual Studio 2008 (.net 3.5) is corrupted.

If I start a new Windows Forms project in a new solution, add the co开发者_C百科de

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.

If I put the same code in the form constructor or in Main, an exception gets thrown like normal.

Any ideas what might be going on?


Don't worry, your VS is fine.

The form load handler will (ultimately) be invoked from the Windows message loop, where exception handling is a little different. See here for more details.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号