TypeLoadException from dynamically loaded assembly

G

Guest

I am running a Compact Framework application using WM2003 SE with CF Service
Pack 2 on an HP 4700. I deploy several custom dlls to the GAC that are used
by my application and also from custom dlls that my application dynamically
loads on startup using the System.Reflection.Assembly.LoadFrom() method. Most
of the time, everything runs and links fine. Every once and a while, however,
the dynamically loaded dll throws a TypeLoadException when attempting to use
a custom type defined in one of the custom dlls loaded in the GAC. A soft
reset will sometimes solve the issue when it occurs. I strong name all the
GAC assemblies and the dynamic dlls are compiled against the same strong
named versions that are put into the GAC.

Are there any known issues with linking to the GAC from a dynamically loaded
dll? Would it be more stable if the GAC was not used at all? (With only one
application using these dlls at this time, I could deploy the dependencies
locally)
 
D

Daniel Moth

dll? Would it be more stable if the GAC was not used at all? (With only
one
application using these dlls at this time, I could deploy the dependencies
locally)
There is absolutely no point in using the GAC or strongly named assemblies
on the CF if they are only being used by a single application. In fact you
are hurting your load performance by choosing to do so.

Cheers
Daniel
 

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