Dynamically import fusion.dll

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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
 
Back
Top