0

I have ASP.Net Core 2.0 MVC app that references several COM objects. I've referenced the COM objects via Visual Studio's Add Reference process. References show in my solution such as

Interop.XYZ

VS automatically set the Embed Interop Types to true, as it's supposed to do.

The solution builds and runs and I can successfully use the methods in these references locally.

When I publish it to IIS on another machine though I get this error:

Retrieving the COM class factory for component with CLSID {5D9E1092-69D4-11D2-BCBB-0000E82BB3D3} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

My app pool has Enable 32 Bit Applications set to true. In my Project Properties, Platform target is set to Any CPU (I tried forcing it to x86 and the site won't even run on IIS after publishing).

I made a clone of the app using .Net 4.7 and configured it the same way, using the same COM references, and published to a second site on the same server. The published version of that app works fine so I don't think it's an issue with the assemblies not being registered (should't be in any case since Embed Interop Types is true for all the COM referenes).

Anybody know what's going on?

agileMike
  • 453
  • 3
  • 14

1 Answers1

0

Not sure of this is related, but there is another question with a similar message and with an answer.

Here is the link:

Link

Ed DeGagne
  • 3,250
  • 1
  • 30
  • 46
  • Thanks, but the link seems broke. – agileMike Oct 18 '17 at 21:27
  • 1
    Thanks, I thought the same thing - I had to debug in 32 bit mode so I was aware that I had to run on IIS the same way. I thought I handled that by enabling 32 bit on my app pool. I'll check out the link and see if maybe I missed something. – agileMike Oct 20 '17 at 00:48