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

发布于 2024-11-18 00:33:08 字数 294 浏览 1 评论 0原文

我认为我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖兔^ω^ 2024-11-25 00:33:08

别担心,你的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文