Com DLL Gives Exception .NET 4 only

0

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?

.net
com-interop
asked on Stack Overflow Aug 29, 2011 by Joel Barsotti • edited Aug 29, 2011 by Joel Barsotti

1 Answer

0

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.

answered on Stack Overflow Sep 5, 2011 by Hans Passant

User contributions licensed under CC BY-SA 3.0