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

  • Thread starter João Santa Bárbara
  • Start date
J

João Santa Bárbara

hi there

i have this error in VS2005 DEV Edition

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

i have create an windows forms application (exe) and in the same project i
have create 2 forms

form1 and form2 , and form2 inherits from form 1.
in the form1 designer it looks ok, but when i open form2 designer ... not ok
it throws this error "Unable to load one or more of the requested types.
Retrieve the LoaderExceptions property for more information."

can someone help me ???

thks
JSB
 
G

Guest

I think you mean the bug somebody already found a work-around for in the
"User Control Designer Errors is [sic] VS2005 RC1" thread.

Change your AssemblyInfo.cs files in the UserControls DLLs as follows:
[assembly: AssemblyVersion("5.5.5")]

Where 5.5.5 is any hard-coded version number. The problem was the .* in it
causing the UserControl to have an auto-generated version that's different
than what your other DLL is expecting. As soon as you recompile it with
changes or something, you get the Unable to Load error.

BTW - Notice I called it a BUG. I truly believe it's a bug. There's a
rational explanation for what it's doing, but it is bound to cause a little
frustration for a lot of people.

Happy coding!
 
R

rob

This does not work for me. Actually the user control is not in a dll
but in the very same project. Therefore, I don't see that versioning
can be the problem. This thing is like SUPER annoying. Here is MS
claiming how much productive developers can be but stuff like that
wastes like so much time. Anybody has a real fix for this?
 
R

raj

Workaround Description:
You would come across this error while trying to view a user control in
the design time that has third party controls in it. ( eg: sync fusion
control). The user control should render fine if it is built using the
regular windows controls.
Reason:- Whenever you create a user control, the .net framework
searilizes the controls into XML (resx file). The new versions of
visual studio (eg: VS2005) will be able to deserealize only the user
controls that are built using the regular windows controls in the
previous version (eg: VS2003). But it will not be able to deserealize
the resx files of third party user control. So all you need to do to
fix the problem is to recreate the resx files for the user controls
with the new version of visual studio.

Workaround Steps:
Heres how you do it.

1. Open windows explorer and go to the folder containing your third
party user controls.

2. Look for the resx file associated with your user control and rename
it (eg: userControl1.resx to userControlOld.resx). You will not need
the renamed resx files but you have it just in..

3. Open your visual studio project/solution and click on "Show all
files" icon on the top.

4. Delete the .resx file for your user control and you should be able
to see your user control in the designer.

5. To recreate the new resx file, try to make some changes to your user
control in the design view(like move a control etc) which will force it
to recreate the new resx file.

Raj Behra
 

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