4

Visual Studio 中有一个著名的错误,它会阻止您在抽象表单的子类上使用表单设计器。

这个问题已经被Urban Potato最优雅地阐明和解决了;那不是我遇到麻烦的部分。麻烦的是,我已经复制了 Urban Potato 描述的技术,并将其包含在我的项目中(恰好相当大),现在每次我尝试打开我的派生形式的设计器时,我都会“可怕地得到微软”对不起,老家伙,但我现在要杀了你”消息(让人想起A Fish Called Wanda中的 Otto ),上面写着“Microsoft Visual Studio 2005 遇到问题,需要关闭。对于给您带来的不便,我们深表歉意。”

真正的关键在于:如果您忽略该消息,并将其塞到屏幕右下角之外,您就可以继续工作,完全正常!只是不要单击“发送错误报告”或“不发送”按钮,因为 VS关闭。

尽管如此,这种现象还是很烦人,我非常希望能够工作,而不会觉得我的 IDE 只是在寻找一些非常讨厌的方式来报复我,因为我现在就放弃它的明智建议——要不然。

更多有用的信息:同样的行为可以在我办公室的所有其他计算机上复制;这不是我的机器特有的。显然项目/代码中的某些东西让 IDE 感到不安,但至少我知道设计模式有效,因为在我忽略了崩溃消息之后,设计器工作得很好。我只是不知道从哪里开始寻找导致这个问题的东西。

有任何想法吗?

谢谢!

4

2 回答 2

1

If it were me, I'd try attaching a debugger (maybe another instance of Visual Studio) to the instance that throws the error dialog, and see if the stack trace gives you any insights into what's causing the error.

于 2008-10-06T19:37:51.070 回答
0

The reason your are getting this problem might be that your base form is an abstracted class. The reason why the IDE will crashes is because the IDE tries to create an instance of the the abstract class which it cannot do.

It might be that you accidentally marked the internal class as abstract too.

Regards,

JvR

于 2008-10-06T15:48:45.290 回答