Form designer problem - cannot load a form

A

Alan T

I got this kind of error recently:

When I tried to open a form I got error something like this:
One of more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.

Look at the lines all are referencing the system things such as

at System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at
Microsoft.VisualStudio.Shell.Design.AssemblyObsoleteEventArgs..ctor(Assembly
assembly)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService.ReloadAssemblyIfChanged(String
codeBase)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService.CreateDynamicAssembly(String
codeBase)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String
fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly,
String description)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchNormalEntries(AssemblyName
assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String
typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String
name, Boolean throwOnError, Boolean ignoreCase)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String
name)
at
System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String
typeName)
at
System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String
typeName)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager
manager, String name, CodeExpression expression)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager
manager, String name, CodeExpression expression)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager
manager, String name, CodeExpression expression)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager
manager, String name, CodeExpression expression)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager
manager, CodeStatement statement)

Any hints ?
 
R

Roman Wagner

There are some things u can do.

1.) rebuild the project and try to open the form
2.) if that fails close VS and open it again
3.) may be there is a bug inside the serialized data in the resx file.
4.) u have a property inside a custom control that needs some other
initialization that the designer can't do

If you have a problem with designer and serialized properties of
costomcontrols see the DesignerSerializationVisibility attribute.
 
A

Alan T

Hi,

I have tried several times say up to 5 or 6 times close solutions, close VS
and reopen, then it fixed. This error suddenly happened.

For (3), how to figure out what is the bug if ther is any?
For (4), how do I know which properties ?

How to read/see DesignerSerializationVisibility ?

This is my situation, in my solution I got several projects (DLL), some DLL
will be referenced by other DLL projects (added in the references). I first
encountered it some days ago, then I moved the whole solution in another
folder, reopen the form with no error. However, then sometime later reopened
with error again.
 
R

Roman Wagner

Serialzationproblem: look at the resx file generated from designer and
search for serealized data.

If u have a dll that needs an other dll add both to the list of
references
 
A

Alan T

I opened the resx of my form and found only one entry in the table:
FolderBrowserDialog.

Now the situation getting worse, every form in my current project cannot be
opened, all have errors.
Other projects in my solution are fine opening the forms with no error.
 
R

Radek Cerny

I often get spurious errors; in other threads the cure is to close VS,
delete the bin and obj folders, open VS, build the project and voila! the
designer works again. Has never failed me yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top