Hi,
I was working on a simple Winforms C# project. I created a few of TableAdapters using the designer and attached them to datagridviews on my form. After realizing that i did not want one of the tables I went to the XSD designer and deleted it. After that the project still excutes ok but the form designer is unable to display the form in design view I get the following error:
One or 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. Clicking on each error will take you to the line of code that caused it.
I am not looking for a response to this problem (creating prototype, kicking the tires ;-)) but hopefully Microsoft will address this issue with some sort of fix. The designer should probably utilize some referential integiry rules (cascade or restirct) before it allows one to remove items that will cause it not to function properly.
Regards
FredV

One or more errors encountered while loading the designer
uhclstudent
I finally found a solution (without any meaningful help from Microsoft Support - they urgently should improve their service to customers!!!!)
a) convert the old .resx files to .resources files via ResGen - after this you will be able to see your forms in Desiger mode again, but you cannot change or amend the resources
b) remove the old .resx files from your project
c) convert the (new) .resources files to new .resx files again with ResGen
d) remove the .resources files from you project and include the new .resx files
All should be functioning now.
I hope this helps also the others who had a similar problem.
I wonder however why this simple procedure cannot be performed by the "upgrade wizard" when opening an old .NET 2003 project the first time in VS 2005!!
Michiel0099
Louis315
tombraider
Hi, IT-Beratung,
Have you found any solution to your problem. I am having exactly the same problem when upgrading from vs2003 to vs2005. The project was built successfully. But the designer couldn't load the forms. The error I got was like:
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 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
I'd appreciate if anyone can help me to solve this.
Daniel Correia
I found this solution on some website, cannot find it now.
Close all the desinger forms in Visual Studio. Close Visual Studio. Delete all the 'bin' and 'obj' files of all projects in your solution.
Relaunch Visual studio and load the project, rebuild it and you can now should be able to see the designers.
Xin Jin
I got the same problem when upgrading a functioning project from Visual Studio .NET 2003 to Visual Studio 2005.
The upgrade wizard went through without errors, and the application can be executed normally, but none of my forms can be displayed in designer view.
I even get no error line number, only a line number 0, and a lot of details like:
at System.Resources.Tools.StronglyTypedResourceBuilder.DefineResourceFetchingProperty(String propertyName, String resourceName, ResourceData data, CodeTypeDeclaration srClass, Boolean internalClass, Boolean useStatic)
at System.Resources.Tools.StronglyTypedResourceBuilder.InternalCreate(Dictionary`2 resourceList, String baseName, String generatedCodeNamespace, String resourcesNamespace, CodeDomProvider codeProvider, Boolean internalClass, String[]& unmatchable)
at System.Resources.Tools.StronglyTypedResourceBuilder.Create(IDictionary resourceList, String baseName, String generatedCodeNamespace, String resourcesNamespace, CodeDomProvider codeProvider, Boolean internalClass, String[]& unmatchable)
at System.Resources.Tools.StronglyTypedResourceBuilder.Create(IDictionary resourceList, String baseName, String generatedCodeNamespace, CodeDomProvider codeProvider, Boolean internalClass, String[]& unmatchable)
at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.BuildType()
at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.GetObjectType()
at Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType()
at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.get_Children()
at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.CreateGlobalObjectsForItem(ProjectItem item, GlobalObjectCollection oldObjects, GlobalObjectCollection newObjects, ITypeResolutionService typeResolver)
at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.CreateGlobalObjects(Project project)
at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObjectProvider.GetGlobalObjectsCore(Project project, Type baseType)
at Microsoft.VisualStudio.Shell.Design.GlobalObjectProvider.GetGlobalObjects(Project project, Type baseType)
at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects(Type baseType)
at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetTypeFromGlobalObjects(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(ITypeResolutionService trs, String name, Dictionary`2 names)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary`2 names, CodeStatementCollection statements, String className)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
I also would really appreciate if Microsoft would fix that asap.
mydarlingdarla
ncj
Yep I also have this problem.
For me it is because I have a custom component and I have added it to several forms. When I make a change to the custom component the form designer will no longer load.
I may have made a mistake on my custom component ..not sure...but this is a major issue because I have at least 5 forms that won't load at all right now.
rollym
Up to now I got no solution to the upgrading problem.
I filed the problem with Microsoft Support, but besides the advise to disable "Localization" in trhe forms before upgrading, which did not solve the problen, I got no further feedback from them. Seems as if Microsoft is not interested in helping to solve its client's problems!!
Wazoo
FredV -
Thanks for posting this issue on the forums. Can you log this suggestion with additional details on the Product Feedback(http://lab.msdn.microsoft.com/productfeedback/) site so we can track it internally
Thanks!
Karen
kkarlin
alexgr
I get this error everytime I make a change to the .xsd file associated with the dataset used by the application. This is a native VS2005 app (not upgraded from 2003), there are no invalid references, so I'm not sure what is causing this, it is very frustrating because I am prevented from editing the form in design view.
In my case I have to restart VS to clear the errors and get back to editing. The app builds fine, runs fine and works great. That is until I edit the .xsd file again, then the cycle starts over.
JulesW
I have encountered this problem too. It seems that it was related to the user controls that I have created. When I created a temporary form and drag the user controls, a messagebox pops up and it tells me the following error:
Failed to create component 'TestControl'. The error message follows: System.NullReferenceException: Object reference not set to an instance of an object at System.Resources.Tools.StronglyTypedResourceBuilder.DefineResourceFetchingProperty(String propertyName, String resourceName, Resource Data, ...
)
The control has the following code:
Option
Explicit OnOption
Strict OnPublic
Class testcontrol Inherits UserControl Public Function CheckedRectangleF(ByVal x As Single, ByVal y As Single, ByVal width As Single, ByVal height As Single) As RectangleF Return New RectangleF(x, y, CSng(IIf(width <= 0, 1, width)), CSng(IIf(height <= 0, 1, height))) End Function Private Sub testcontrol_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim recfBox As RectangleF Dim lbr As LinearGradientBrushrecfBox = CheckedRectangleF(0, 0,
Me.Width - 1, Me.Height - 1)lbr =
New LinearGradientBrush(recfBox, Color.CornflowerBlue, Color.DarkBlue, LinearGradientMode.Vertical)e.Graphics.FillRectangle(lbr, recfBox)
lbr.Dispose()
End SubEnd
Classmark baran
This has happened to me also, on more than one occasion.
Sometimes I am able to get around it by editing the designer code and removing the erroneous references.
Other times I wind up having to junk my form and start fresh. And the acceptability of doing that is inversely proportional to the amount of time you've spent customizing it.
So unlike the original poster, I really am looking for a solution to this problem.