Embedded Interop REGDB_E_CLASSNOTREG error on client machine

-1

I've compiled my app as x86. I'm using a VB6 COM Interop in my app. I've set the reference to "Embed Interop type=Yes", "Isolated=No".

I don't need to install anything on the client machine, not even the "Interop.MyDLL.dll", it magically worked without installing anything.

I can test this easily on my test computer, it works just fine.

Now, on a client machine the error "System.TypeInitializationException, class not registered, HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)" is thrown when I try to access the DLL.

It occured after I recompiled the app and deployed it. Before that, it worked fine.

What might be the culprit here?

vb.net
visual-studio-2017
interop
com-interop
asked on Stack Overflow Dec 6, 2017 by tmighty • edited Dec 6, 2017 by tmighty

1 Answer

1

There's not "magic" with COM, you must register the VB6 COM component (dll, ocx, etc.).

The interop .NET dll is not a COM component, it just contains metadata/binding from .NET to COM, so it doesn't need to be registered.

PS: in fact, you don't have to register, you just need to give clients a way to find you, so there's also the possibility to use Registration-Free Activation of COM Components: A Walkthrough, but it can be more work than simply register a bunch of dlls.

answered on Stack Overflow Dec 6, 2017 by Simon Mourier

User contributions licensed under CC BY-SA 3.0