I have a project built with .NET 4.0. I have a lot of code that would be painful to convert back to 2.0.
I try to import a Dll built with .NET 2.0. Everything works until I try to execute code from that DLL. It says that it cannot load the specified module or one of its dependency
I used dumpbin.exe to check what dependencies it can have
File Type: DLL
Section contains the following imports:
mscoree.dll
402000 Import Address Table
4057F0 Import Name Table
0 time date stamp
0 Index of first forwarder reference
0 _CorDllMain
So my guess here is that the dll tries to load, but cannot find mscoree.dll from version 2.0 and thus raises an Exception.
I tried to load my target module manually with
Assembly asm = Assembly.LoadFrom(dllPath);
Visual Studio debugger now list the module as loaded, but still it cannot access it. Windows search reports dozens of "mscoree.dll" scattered everywhere in the c:\windows directory so I'm a little sceptical about loading it manually.