A COM DLL works in .NET 3.5 SP1, but gives exception in .NET 4.0
The full error is
Retrieving the COM class factory for component with CLSID {B229C879-1B52-4DE9-A42B-75C415EA1EBC} failed due to the following error: 8007045a A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A).
If I change the target framework to 3.5 it works, back to 4.0 it doesn't.
The application is a desktop WPF app.
How can this be solved?
The DllMain() method of the DLL returned FALSE. You'll need to use a debugger to find out why. Set a breakpoint on it and enable unmanaged debugging with Project + Properties, Debug tab. Source code and a .pdb file for the DLL is required.
User contributions licensed under CC BY-SA 3.0