Rupreet's Weblog

Looking deep inside under the hood

  Home  |   Contact  |   Syndication    |   Login
  11 Posts | 0 Stories | 27 Comments | 59 Trackbacks

News

Archives

Post Categories

Last week, i got the resolution for one the Designer Issue we were facing and this week we bumped into another. Here is the Designer error message we get when we open up winform.

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.


Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Hide    


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.SearchProjectEntries(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, 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)

 

Cause:

I don’t have any concrete reason for this, but I am assuming that VS2005 has some kind of assembly cache which it maintains and while designing the form, somehow it gets corrupted, hence we get this error.

 

Workaround:

Follow the steps and it should work fine then!

 

1. When you open your form and you get this error. Close all the forms.

2. Close VS.NET (make sure none of the forms are open at this time)

3. Delete "bin" and "obj" folder physically.

4. Open VS.NET

5. Rebuild your application

6. Try opening your forms now. It should work!

posted on Wednesday, December 21, 2005 9:26 AM

Feedback

# re: VS2005 Another Desinger Issue - Winforms not opening 1/12/2006 3:10 AM Lee Grissom
Our entire team is having the same exact problem. Your solution was encouraging, however, it only solves the problem between rebuilds. If I do another "re-build", I then have to restart VS2005 again. Is there a work-around that solves this once and for all? Thanks.

# re: VS2005 Another Desinger Issue - Winforms not opening 1/12/2006 10:43 AM Rupreet Singh Gujral
Well, i dont have any permament solution to this till now. Other way is you go to Solution -> Clean Solution and rebuild it. Again your designer forms should be closed while doing this. This should also work. If i get a permanent solution to this, i'll post it here.

# re: VS2005 Another Desinger Issue - Winforms not opening 1/18/2006 11:57 AM Ian Posner
I believe the problem is caused by the Indexing Service locking the obj and bin files, trying to reindex their contents. Simply select your Projects folder in Explorer, go to Properties..., click the Advanced button and disable the checkbox to allow the indexing of the folder and subdirectories and files.

# re: VS2005 Another Desinger Issue - Winforms not opening 1/20/2006 3:56 PM Erling Sævik
Ian's solution worked for me so I'm happy :-) Thanks a lot.

# re: VS2005 Another Desinger Issue - Winforms not opening 2/7/2006 12:12 PM Mark Ingram
Thats great, been struggling with that this morning and both those solutions helped. Thank you.

# re: VS2005 Another Desinger Issue - Winforms not opening 2/16/2006 3:17 PM DAVE
Ur the best > this solutions did it > dont forget to use the windows explorer


# re: VS2005 Another Desinger Issue - Winforms not opening 4/6/2006 6:41 AM ishi
Thanks!!!!
I was able to open my form which was upgraded from VS2003 with disable indexing.
I don't need to get an order hotfix.



# re: VS2005 Another Desinger Issue - Winforms not opening 4/14/2006 7:14 PM Greg
Didn't work for me. I turned off indexing on the folders and I checked and I had already turned off the indexing service so this couldn't have been the problem. Is there another fix?

# re: VS2005 Another Desinger Issue - Winforms not opening 6/20/2006 8:25 PM Jim
this appears to work sometimes... Thanks.

# re: VS2005 Another Desinger Issue - Winforms not opening 6/21/2006 11:24 PM sklett
WOOOOOORD!
God, this is the most annoying bug, thanks for the fix!

# re: VS2005 Another Desinger Issue - Winforms not opening 6/30/2006 10:10 PM sd
There is actually a patch for this from Microsoft. But you have to have a support plan to get them to send it to you.

# re: VS2005 Another Desinger Issue - Winforms not opening 6/30/2006 10:11 PM sd
Oh yeah, it's:
VS.NET 2005 Hotfix 265517_ENU_i386


# re: VS2005 Another Desinger Issue - Winforms not opening 8/3/2006 8:52 AM Nishant Rana
Ya i was also having the same proble for me
the first solution i.e. to delete the bin and object folder and rebuliding the application
worked thanks a lot

# re: VS2005 Another Desinger Issue - Winforms not opening 8/11/2006 4:32 PM Nishant Rana
hi freind

even i was getting this error frequently

one solution was deleting the object and bin folder and open the solution and rebuild the project

it worked fine but it was still creating problems because in my project i was referecing some 3 or 4 assemblies

so project still wasn't running properly

change the references might work but still not sure



The solution i have found for this is whenever such an error occurs

i immediately open the same solution in another instance of vs.net 2005 without doing anything eg. rebuilding or cleaning the solution

and that works fine for me and i just close my older vs.net 2005 instance without any save





# re: VS2005 Another Desinger Issue - Winforms not opening 8/22/2006 12:07 AM harry
I ran into this issue, similar but with different cause. it was cause by I add a class (say name Dataclass) in the same .cs file which is a winform. If I add Dataclass on the top of the cs file, I ran into problem not be able to display the winform in design view, but If I move the Dataclass to the bottom of the cs file, it fixed the problem.

# re: VS2005 Another Desinger Issue - Winforms not opening 9/1/2006 12:15 AM Thiago
Could someone send me that hotfix?

thiagohealer at terra.com dot br

Tkx;





# re: VS2005 Another Desinger Issue - Winforms not opening 10/13/2006 12:58 AM Ivan Vernot
Hello All,
None of the above has helped me :-(
I have the saem error but the 'detail's are different.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.GetValueNames()
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.AppendWindowPanes(RegistryKey parentKey, ArrayList windowPanes)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.GetRegisteredPanes(String extension)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.DeferredWindowPane.EnsurePane()

Has anyone come accross this one and solved it?
Any hints would be appreciated
Ivan


# re: VS2005 Another Desinger Issue - Winforms not opening 1/12/2007 8:51 PM Shreeve
I have the same problem Ivan:
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.
...
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.GetValueNames()
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.AppendWindowPanes(RegistryKey parentKey, ArrayList windowPanes)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.GetRegisteredPanes(String extension)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.DeferredWindowPane.EnsurePane()

I have no idea what to do now... it makes me angry...

# re: VS2005 Another Desinger Issue - Winforms not opening 1/23/2007 8:29 PM Karthik
Great help, thanks

# re: VS2005 Another Desinger Issue - Winforms not opening 2/11/2007 8:59 PM Kushal
Hey Ivan & Shreeve,

Have you managed to resolve the problem? I'm also stuck with this :(

# re: VS2005 Another Desinger Issue - Winforms not opening 2/23/2007 3:06 PM Reiner
I got this problem too, but a little different. On two different forms I added one from two self created components, just simple panels with TextBoxs, Buttons, Label etc. If I open these two forms I got the error message. All other forms can be opened without problems. The whole solution compiles and runs very fine. :-(


# re: VS2005 Another Desinger Issue - Winforms not opening 4/27/2007 8:37 AM Manali
hi all, i have same problem with different error message and i face this problem when i put the datagrid on which i have applied some skins...i disabled the indexing option but it's still not working.can anybody help me?? pls find out some solution.
the error message i got,

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.

Parameter is not valid.
Hide

at System.Drawing.Pen.set_DashPattern(Single[] value)
at WorldVuer.JUI.JDataGrid..ctor()

The variable 'jDataGrid1' is either undeclared or was never assigned.
Hide Edit



at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

The variable 'jDataGrid1' is either undeclared or was never assigned.
Hide Edit

at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
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)

The variable 'jDataGrid1' is either undeclared or was never assigned.
Hide Edit

at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
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)

thanx


# re: VS2005 Another Desinger Issue - Winforms not opening 5/13/2007 9:51 PM Arunagiri GT
Me too faced the same problem.

I used to close the design window and open it by right-click the file from "Solution Explorer" and select "View Design" instead of using short-cut keys. This works for me several times. But if the design really has some bug, then you've to remove/edit the code manually to overcome this issue.

Regards,

Arunagiri GT


# re: VS2005 Another Desinger Issue - Winforms not opening 7/18/2007 4:43 PM Wahoo!
Switching folder indexing off worked for me too! It's always great to find such a simple fix for such nasty, nerve wracking little problems... :-\

# re: VS2005 Another Desinger Issue - Winforms not opening 10/8/2007 2:55 PM Mm
We had this issue in our project couple of months ago.
The problem we had was Dev environment dlls went out of sync.Contact microsoft for right version of dlls.We had this issue after we installed sp1.Versions went out of sync and screwed up whole GUI.When loading forms GUI is looking at wrong dlls.




# re: VS2005 Another Desinger Issue - Winforms not opening 11/6/2007 9:39 PM jfaria
Does anyone already have the path, the VS.NET 2005 Hotfix 265517_ENU_i386???? All the solutions solutions doesn't work with me, can any one that have it post a link?????
Thanks
JF

# re: VS2005 Another Desinger Issue - Winforms not opening 11/8/2007 8:55 AM nelusan
Yeah, i submit too. Neither of the solutions above work for me. From time to time i have this thing going on, except for the one with the restart of VS and that's unacceptable.

Does anyone have the path to the patch? or that ..design.dll that's beeing patched. pleeeeeeeaase!!!!!

... i would be very gratefull
it would be a good did for the man kind

# re: VS2005 Another Desinger Issue - Winforms not opening 1/15/2008 3:41 AM mcbus
Hi,

Me too faced the same problem.
I solved it with installing the SP1 for Visual Studio 2005.
File: VS80sp1-KB926601-X86-ENU.exe from the Microsoft Download Sides.

from the seven hills by the Rhine
Achim Busenbender
Wirtgen




# re: VS2005 Another Desinger Issue - Winforms not opening 1/22/2008 3:34 AM Naresh prajapati
have the same problem
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.
...
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.GetValueNames()
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.AppendWindowPanes(RegistryKey parentKey, ArrayList windowPanes)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.GetRegisteredPanes(String extension)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.DeferredWindowPane.EnsurePane()

I have no idea what to do now..

# re: VS2005 Another Desinger Issue - Winforms not opening 1/28/2008 12:51 AM sachin bobade
hi this solution works fine to me

# re: VS2005 Another Desinger Issue - Winforms not opening 3/4/2008 5:12 PM geeta
Turning off the indexing service and restarting my machine worked for me !

# re: VS2005 Another Desinger Issue - Winforms not opening 3/13/2008 2:40 AM bhnhan
I too. Help me. I try turn off the indexing service and restarting my machine but still the same.

# re: VS2005 Another Desinger Issue - Winforms not opening 3/18/2008 11:27 AM arian
thanks .. this work fine to me too

# re: VS2005 Another Desinger Issue - Winforms not opening 5/23/2008 8:14 AM Ghazanfar
@mcbus
Are you facing the problem I listed below. And also are you using VS 2005.

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.
...
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.GetValueNames()
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.AppendWindowPanes(RegistryKey parentKey, ArrayList windowPanes)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.GetRegisteredPanes(String extension)
at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.CreateWindowPane(DesignSurface surface)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.DeferredWindowPane.EnsurePane()

# re: VS2005 Another Desinger Issue - Winforms not opening 6/16/2008 12:25 PM Roland
First I rebuild - didnt work Then clean, remove indexing => dint work.
Closing all and restarting VS -> Then it was OK
(dont know wether index off cahnged anything but I hope ist OK now)
Also for me - its only buggy on some forms with custom controls
Thanks a lot for the ideas !

# re: VS2005 Another Desinger Issue - Winforms not opening 1/8/2009 11:35 PM Vijay Nag
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.

The class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.
Hide

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 got this error.I tried all the solutions above.Dint work.Help me out pls??

# re: VS2005 Another Desinger Issue - Winforms not opening 3/7/2009 9:17 PM Richard
I figured this problem out at least for me. In my usercontrol I had a public property that was given a value of nothing by the designer. the nothing value was causing the null reference.

hope this helps.

Richard


# re: VS2005 Another Desinger Issue - Winforms not opening 3/19/2009 2:12 PM Saravanan
Thanks tat solved the issue. I just tried to find the error control using the find text option. (System.Windows.Forms.AxHost...) in the whole project and i just kept commeting the controls initialisation and other events.. I kept doing this in all forms which had error. Finally i rebulit it and restarted my VS2005. After tat i could see the design page..

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: