471,618 Members | 1,077 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,618 software developers and data experts.

ReflectionTypeLoadException question

We just converted our Visual Studio 7.1 development projects to Visual Studio
8.0 (2005).

I am working on a form, and I want to add one of the custom controls that we
had developed under 7.1 (2003) and stored in its own project.

When I attempt to add this control (drag and drop) I get the above error. I
am trying to figgure out how to solve this so we can use/look at our code.

I tried running the project in question in the VS2005 devenv, opening up
another project, and adding the control again, so I could trap the error...
only to have the control add just fine.

Short of going in and sequentially commenting out all the controls on the
various forms, and then uncommenting out one control at a time to find the
suspect one(s), does anyone have an idea how to find and fix this issue?

Here is the full message I get dropped on me when I tried to add the control
originally:
"Failed to create 'useNumericTextBox'. The error message follows:
'System.Reflection.ReflectionTypeLoadException: Unable to load one or more
of the requested types. Retreive the LoaderExceptions property for more
information.
at System.Reflection.Module.GetTypeInternal(StackCraw lMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at
Microsoft.VisualStudio.Shell.Design.AssemblyObsole teEventArgs..ctor(Assembly
assembly)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService .ReloadAssemblyIfChanged(string codeBase)
at
Microsoft.VisualStudio.Design.VSDynamicTypeService .CreateDynamicAssembly(String codeBase)
at
Microsoft.visualStudio.Design.VSTypeResolutionServ ice.AssemblyEntry.get_Assembly()
at
Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.AssemblyEntry.Search(String
fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String
desctiption)
at
Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.SearchProjectEntries(AssemblyName
assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Micr..'

it ran out of space....

Any ideas would be helpful. From the above, I now _something_ in this
assembly I am pulling the control from is obsolete... but I have no idea what.

Andrew S. Giles

Dec 15 '05 #1
1 2925
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.

Let me know if it works.
Jan 25 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Stevey | last post: by
10 posts views Thread by glenn | last post: by
53 posts views Thread by Jeff | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.