Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 Designer Error on Run

I am using using VS2010 and if I have a form open in designer mode and run my application the designer tab will no longer show the form designer but instead an error will be displayed (and it is only fixed by restarting the IDE) saying:

"To prevent possible data loss before loading the designer, the following errors must be resolved:"

1 Error:

"The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: ##### --- The base class ##### could not be loaded. Ensure the assembly has been referenced and that all projects have been built"

I then shows the following call stack:

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)

Any help is greatly appreciated this is really annoying.

Thanks,

Joel.

like image 990
Joel Avatar asked Feb 18 '11 01:02

Joel


People also ask

What is design time error?

Recipe design-time errors refer to errors which are caught while building a recipe. These errors typically show up when you select recipe test or recipe start, and prevent you from testing or starting the recipe until they are resolved.

Can't see Windows Form Designer?

We need to enable the designer in Visual Studio. Go to Tools > Options > Environment > Preview Features and select the Use the preview Windows Forms designer for .


1 Answers

I get this visual studio bug too now and then, and I deeply ignore the error text, instead I do the following:

  1. Close the Design-tab
  2. Reopens the Design mode by double click in Solution Explorer, or by right clicking Source code tab and select View Designer
  3. Suddenly everything works again!

If not helping, you may have to change bullet 2 into: Close and restart Visual Studio.

Maybe this can help you out.

like image 137
Jack Johnstone Avatar answered Oct 06 '22 01:10

Jack Johnstone