GUI 线程中的异常导致 vshost.exe 崩溃
我认为我的 Visual Studio 2008 (.net 3.5) 已损坏。
如果我在新的解决方案中启动一个新的 Windows 窗体项目,将代码添加
double[] x = new double[2];
x[3] = -1.0;
到 form_load 处理程序(或按钮处理程序),并尝试调试该程序,它会立即崩溃,不是抛出异常,而是实际崩溃。
如果我将相同的代码放入表单构造函数或 Main 中,则会像平常一样抛出异常。
有什么想法可能会发生什么吗?
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 code
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
别担心,你的VS没问题。
表单加载处理程序将(最终)从 Windows 消息循环中调用,其中异常处理略有不同。有关详细信息,请参阅此处。
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.