I am trying to upgrade an old asmx webservice to Web API. Idealy I would like to use .Net Core as that is what we have been developing in. The issue is that the API must communicate with a legacy system using a COM object.
I have copied over the dll (already not ideal, I know) and, the .Net Core API project is able to add it as a reference and the code all compiles. However, on running the code I get the following error when instantiating an object from the dll:
Retrieving the COM class factory for component with CLSID
{CCA0B90B-DFDE-4DD3-9C7B-9769A3F12201} failed due to the following error:
80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I've tried to do exactly the same thing using the full .Net framework and everything works as expected so I imagine it is an issue with Core - maybe the portability requirements.
It will not be possible to rewrite the integration to the legacy system at this point and I was just wondering if there was any way around this without using the full .Net framework.
Update
I don't know if this will help but I can created a .Net Framework console app which runs the code just fine. when I reference the project from my .Net Core API and call the exact same code the error above still occurs.