Sometimes when working with a solution containing multiple projects, with several forms some of them containing user controls, Visual Studio .NET 2005 produces the following error when you try to open the form in the form designer:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
In some cases the following approach helps solving this issue:
- Close the form designer
- Close the solution and Visual Studio
- From the project that contains the problematic form delete the bin and the obj folder
- Start Visual Studio again and load your solution
- Rebuild the solution
- Reload the form
Not nice, but at least it's a workaround.
I don't know yet how to reproduce the issue, but it seems to be related to user controls in one project which are used in a form in a different project.
Hi Mate,
ReplyDeletethis absolutely didnt work for me :
and i also tried to change the AssemblyVersion to a fixed number instead of using the star character for autoincrementing, as said in some posts.
I'm working in a single assembly,
in which I declare 1 control that uses a third party control.
The error i've got is :
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)
Well, as I said, it sometimes works. You seem to have encountered a different scenario in which my solution doesn't work.
ReplyDeleteThanks for your post. Your suggestion worked for me!
ReplyDeleteIt also worked for me, thanks.
ReplyDeleteExcelelnt, worked a treat!
ReplyDeleteI was figuring this out the whole of today. It occured after I added user controls in the main project. Deleting "obj" directory worked for me. TY.
ReplyDeleteI have this problem with vs 2005 using the Web Client Software Factory - Clean and Rebuild worked for me
ReplyDeleteHi...
ReplyDeleteThis is a very helpfull to me thanks...
This also worked with a Silverlight application too. Thanks!
ReplyDeleteWorked for me!
ReplyDeleteThat worked for me. :)
ReplyDeleteThanks! After 5 years it solved my problem on Visual Studio 2008 too.
ReplyDeleteTry turning off "For fast searching, allow Indexing Service to index this folder" on the project or solution folder. Just select properties on the folder and click advance.
ReplyDeleteI had the same problem with WPF windows in design mode. I knew restarting VS 2008 and rebuilding the project usually solves the problem but in this case it didn't. I absolutely could not locate any bug.
ReplyDeleteDeleting bin and obj worked for me. Great! Thank you very much :).
I solved it my changing the configuration 'Any CPU' from 'Mixed Platform'
ReplyDeleteI do not know... what is the reason... but the solution worked for me.... THANKS A LOT
ReplyDeleteThank you!
ReplyDeleteSeems it work for me!
-Ranjit