简体   繁体   English

vs2010 Windows应用程序设计时错误

[英]vs2010 windows application design-time error

we have a problem with a custom user control in a windows application project. Windows应用程序项目中的自定义用户控件存在问题。 we use visual studio 2010 (c#). 我们使用Visual Studio 2010(c#)。 when we open the design view of a form that includes a custom control, the design view shows the following error: http://i.imgur.com/Li9qC.jpg 当我们打开包含自定义控件的窗体的设计视图时,设计视图显示以下错误: http : //i.imgur.com/Li9qC.jpg

the form belongs to ui.forms while the custom control belongs to ui.controls. 表单属于ui.forms,而自定义控件属于ui.controls。

this error appeared suddenly, and even if we revert to an older revision, it still appears. 该错误突然出现,即使我们恢复到较旧的版本,它仍然会出现。

if we click on "ignore and continue", the first error doesn't cause any problem, but the control "specializzazioni1" doesn't appear in the form anymore. 如果单击“忽略并继续”,则第一个错误不会引起任何问题,但是控件“ specializzaziazi1”将不再出现在表单中。 anyway, at execution time, it appears correctly. 无论如何,在执行时,它会正确显示。

Some times below helps to catch design time errors. 下面的某些时间有助于捕获设计时错误。 Reference 参考

1) Start a second instance of visual studio 1)启动Visual Studio的第二个实例

2) go the the Tools menu, "Attach to process", select the 'devenv.exe' process, and click the 'attach' button. 2)进入“工具”菜单的“附加到进程”,选择“ devenv.exe”进程,然后单击“附加”按钮。

3) In the Debug/Exceptions menu, 3)在[除错/例外]选单中, 在此输入图像描述 Turn on exception catching when first thrown (in the Debug->Exceptions menu). 第一次抛出异常时打开异常捕获(在“调试”->“异常”菜单中)。

4) Open the designer with the debugger attached. 4)打开附带调试器的设计器。

5) The second visual studion will break on your error. 5)第二个视觉工作室会因您的错误而中断。

Usually when you encounter errors like this in the VS designer it's because an exception is thrown in the constructor of your user control \\ form - so i'd check what's going on there to begin with. 通常,当您在VS设计器中遇到这样的错误时,这是​​因为在用户控件\\窗体的构造函数中引发了异常-因此,我将首先检查发生了什么。 Maybe you're doing some kind of initialisation that's going wrong ? 也许您正在做某种初始化错误的事情?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM