vs2010 windows application design-time error
we have a problem with a custom user control in a windows application project. we use 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
the form belongs to ui.forms while the custom control belongs to 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. 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
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,
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.
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. Maybe you're doing some kind of initialisation that's going wrong ?
精彩评论