TypeLoadException

  • Thread starter Thread starter marko
  • Start date Start date
M

marko

I'm loading assembly with reflection as the following:

System.Reflection.Assembly assPlugin =
System.Reflection.Assembly.LoadFrom(sFile);

then: Type[] tpePluginTypes = assPlugin.GetTypes();

but this statement always Exception: System.TypeLoadException

thanks
msk
 
Just type 'Typeload' in the newsgroup
microsoft.public.pocketpc.developer
and look for date 17/1/2005 post by Greg.
Saurabh
 
The problem appears in the sFile assembly that you was trying to load.
For example one of classes in the sFile assembly is derived from
Assembly2.SomeClass but Assembly2 is absent. Then the Assembly.LoadFrom
will be executed normally but assPlugin.GetTypes() will throw exception
TypeLoadException because Assembly2 with a base class is missing.


Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
 
Back
Top