Windows应用程序例外 [英] WINDOWS APPLICATION EXCEPTION

查看:81
本文介绍了Windows应用程序例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击了构建项目,然后

创建表单时发生错误.有关详细信息,请参见Exception.InnerException.错误是:对象引用未设置为对象的实例.

clicked build project and

An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.

推荐答案

这里是我的建议:在调试器下运行它.当在引发异常的位置停止执行时,请参见Exception.InnerException.这些细节非常有用(与您的问题相反),以至于大多数开发人员都可以立即看到他们搞砸的地方. :-)

如果您不会立即看到它,请在引发异常的位置之前立即设置一个断点.查看下一条语句.对所有涉及的变量使用快速查看"(在上下文菜单中).我敢打赌,其中一个为空,但您的下一个赞未考虑在内.当您看到此内容时,您肯定会看到该怎么做.

祝你好运,
—SA
Here is my advice: run it under debugger. When execution is stopped where the exception is thrown, see Exception.InnerException for detail. Those details are so informative (in contrast to your question), that most developers can immediately see where they screwed up. :-)

If you won''t see it immediately, set a breakpoint immediately before the point where the exception is thrown. Look at the next statement. Use "Quick view" (in context menu) for all the variables involved. I bet one of them is null, but your next like does not take in into account. When you see this, you will certainly see what to do with that.

Good luck,
—SA


这篇关于Windows应用程序例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆