I am getting the following error when I try to open the designer for some of the forms in my project. I have no clue why this is happening.


Object reference not set to an instance of an object.

at Microsoft.CompactFramework.Design.DeviceTypeResolutionService.EnsurePopulated(Boolean fPopulateProject)
at Microsoft.CompactFramework.Design.DeviceTypeResolutionService.SearchNormalEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Boolean reflectionBased, Assembly& assembly)
at Microsoft.CompactFramework.Design.DeviceTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Boolean reflectionBased, Assembly& assembly)
at Microsoft.CompactFramework.Design.DeviceTypeResolutionService.GetDeviceType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.CompactFramework.Design.DeviceTypeResolutionService.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.DesignerHost.System.ComponentModel.Design.IDesignerHost.GetType(String typeName)
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)

Re: Windows Forms Designer designer errors: Object reference not set to an instance of an object


1. It is call WSOD. Google visual studio WSOD

2. If you browse this forum you will see a lots of people have the same problem, lots of different error messages.

3. The cause is the form designer sucks. Micosoft said it is a "feature", one we could do without.

4. Solution - there are several, one is close VS and delete the obj and bin directories and try again - never work for me but seems to work for some people.

5. Solution - mine is to comment out all of MYFORM.designer.vb. Use a copy your project of course.

Your form should display - empty.

Close the form. Start uncommenting from the top. Keep trying to open the form in the designer.

You should find the line(s) causing problem.

Good luck