Design-Time Errors in the Windows Forms Designer

Switch View :
ScriptFree
.NET Framework 4 - Windows Forms
Design-Time Errors in the Windows Forms Designer

Updated: October 2010

This topic explains the meaning and use of the design-time error list that appears in Microsoft Visual Studio when the Windows Forms Designer fails to load. If this error list appears, you should not interpret it as a bug in the designer, but as an aid to correcting errors in your code.

A basic understanding of this error list will help you debug your applications by providing detailed information about the errors and suggesting possible solutions.

The Design-Time Error List Interface

If the Windows Forms Designer fails to load, an error list will appear in the designer. The errors are grouped into categories. For example, if you have four instances of undeclared variables, these will be grouped into the same error category. Each error category includes a brief description that summarizes the error.

You can expand or collapse an error category by either clicking on the error category heading or by clicking the expand/collapse chevron. When you expand an error category, the following additional help is displayed:

  • Instances of this error.

  • Help with this error.

  • Forum posts about this error.

Instances of This Error

The additional help list all instances of the error in your current project. Many errors include an exact location in the following format: [Project Name] [Form Name] Line:[Line Number] Column:[Column Number]. The Go to code link takes you to the location in your code where the error occurs.

If a call stack is associated with the error, you can click the Show Call Stack link, which further expands the error to show the call stack. Examining the stack can provide valuable debugging information. For example, you can track the functions that were called before the error occurred. The call stack is selectable so that you can copy and save it.

Note Note

In Visual Basic, the design-time error list does not display more than one error, but it may display multiple instances of the same error. In Visual C++, the errors do not have goto code links/line number links.

Help with This Error

If the error contains a link to an associated MSDN help topic, the additional help will include a link to the help topic. When you click the link, the associated help topic appears in Visual Studio.

Forum posts about this error

The additional help will include a link to MSDN forum posts related to the error. The forums are searched based on the string of the error message. You can also try searching the following forums:

Ignore and Continue

You can choose to ignore the error condition and continue loading the designer. Choosing this action may result in unexpected behavior. For example, controls may not appear on the design surface.

See Also

Tasks

Other Resources

Change History

Date

History

Reason

October 2010

Added links to forums.

Customer feedback.

Community Content

alankdkd
Bad design
Visual Studio 2010 won't show me the form because it claims it can't find a class.  But it effortlessly finds the class when I RUN the program.  Conclusion: Bad design of the Windows Forms Designer.

aboatsk
delete .suo file
delete the [solutionname].suo file which contains designer layout info from your previous session, then start the project and rebuild..

user22222
fxxk u microsoft. got no where to fix the problem, and lost my hours work!!!!!-

Peaunt
Not locating or describing where the error is.
I agree how is it that windows media player is ever so complicated to integrate, I have look at this from so many angles and just cant figure out why it is not giving me a clear reason for not showing where the problem lies.

Angelastro
Could not find type "AxWMPLib.AxWindowsMediaPlayer".
I had a working app using the Windows Media Player in VS2010, but after I copied the files in the project's Debug folder somewhere else to use it compiled, I get this error in VS.  The compiled one however works but I want to enhance it and VS won't let me.  Any ideas?

Thanks.

Mike.Angelastro@gmail.com

threeoaksdesign
Worthless Error
This error is awful.  I have a 3rd party control im trying to use and I get this so I can't view the code to see whats going on.  Does anyone have a good workaround? Is there a way to skip error messages?$0

Sir Royce T
My form wont open on other pc's, wish i knew how to resolve this problem
Failed to parse the following code: Me.grdDisplay = New UJ.Grid() The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.

Antonanton
Eventhandlers
Just comment out all eventhandlers. Rebuild the project and then uncomment the eventhandlers again and rebuild. It worked for me

DanWoerner
Unstable environment
This problem is garbage!!! $0My designer was just working, I added one property now nearly every line in InitializeComponent has an error. $0 $0The program runs perfectly fine.$0 $0I removed the property I put in last and the designer still won't load. $0 $0It's a huge project so I can't just start over.$0 $0Whats up Microsoft??? I have VS2010Pro v10.0.40219.1 SP1Rel and I hope you fix this bug soon.$0 $0$0 $0

Inoodat
Things to Try
Things to try include:$0 $0 $0Make sure your project compiles$0 $0Close and reopen the Designer window $0 $0Exit and restart VS$0 $0Make frequent backups, sometimes you may have to back up to a version that worked then bring in incremental changes $0 $0Build your solution. Debug -> Build solution.  This will compile all files and resolve all references.$0 $0

SoulFireMage
This never helps me.
I had this damned error on something I'd been trying to create all day. I had a final success with this simple control, then copied it to another file to reuse as another control.

Now I'm screwed completely and about to kill all of my code in sheer frustration at the opacity of the error. It won't even declare the type anymore, yet it's all there!!!!

georgeATlinear
Very difficult to find the offending line
There are several errors here for VS2010:
1) While you can select text in the 'call stack' there is no right click menu, and the 'copy', in the Edit Menu is greyed out.
2) I'm getting a warning in the error list but the form designer says it is an error and refuses to load the form.
3) My warning has Line and Column set to '0', and Goto does nothing.

LostLight
Error when displaying form after form name change VB.NET 2010
A restart of the project.