Dynamically import fusion.dll

G

Guest

I'd like to dynamically import methods from the fusion library (fusion.dll).
However, if I just do a straight [DllImport(blah)], I can't guarantee that I
get the .Net 2 runtime version.

I've found that the unmanaged method LoadLibraryShim in mscoree.dll will
return a module handle to the latest runtime version, the thing I can't
figure out is how to then use this handle to invoke methods on the library
from C#.

Any hints gratefully received!
 
M

Mattias Sjögren

Will,
I'd like to dynamically import methods from the fusion library (fusion.dll).
However, if I just do a straight [DllImport(blah)], I can't guarantee that I
get the .Net 2 runtime version.

Since fusion.dll is used by the CLR itself you should get the "right"
version corresponding to the CLR version you've loaded if you simply
use DllImport("fusion.dll"). That is, if you make sure your app runs
under the v2.0 CLR you should get the desired DLL version. Isn't that
what you want?


Mattias
 

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