1

我们在Windows应用程序项目中存在自定义用户控件的问题。 我们使用visual studio 2010(c#)。 当我们打开,其包括一个自定义的控制形式的设计图,设计视图显示以下错误: http://i.imgur.com/Li9qC.jpgvs2010 windows应用程序设计时错误

形式属于ui.forms而定制控制属于ui.controls。

这个错误突然出现,即使我们恢复到较旧的版本,它仍然会出现。

如果我们点击“忽略并继续”,第一个错误不会导致任何问题,但控件“specializzazioni1”不会再出现在表单中。无论如何,在执行时,它看起来是正确的。

+0

卸载/重新加载项目浏览器中的项目。它应该消失 – AbiusX

回答

0

通常当你在VS设计器中遇到像这样的错误时,这是​​因为在你的用户控件\ form的构造函数中抛出了一个异常 - 所以我会检查那里是怎么回事。也许你正在做一些初始化错误?

3

以下时间有助于捕捉设计时间错误。 Reference

1) Start a second instance of visual studio

2) go the the Tools menu, "Attach to process", select the 'devenv.exe' process, and click the 'attach' button.

3) In the Debug/Exceptions menu, enter image description here Turn on exception catching when first thrown (in the Debug->Exceptions menu).

4) Open the designer with the debugger attached.

5) The second visual studion will break on your error.

+1

非常有帮助,谢谢! – mcanti