I tried to put the COM DLL in the webservice project (using the code below to include it):
<Project ...>
<ItemGroup>
<COMFileReference Include="itaucripto_.dll">
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMFileReference>
</ItemGroup>
</Project>
Is there anything else I need to do in a WCF service with asmx? The server raises an exception saying that it can not find the COM class because it is not registered. I do not want to register the DLL on the server; but instead I want to call her without a record. Environment:
- Visual Studio 2017
- WCF service application with a web service asmx (I'm trying to instantiate the COM object in the HelloWorld method of asmx)
Code:
Itaucripto.cripto itau = new Itaucripto.cripto();
Exception:
An exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll but was not handled in user code
Additional information: Retrieving the COM class factory for component
with CLSID {E9067548-B9D1-4146-BEDC-0F7BFEDF6E94} failed due to the
following error: 80040154 Class not registered (Exception from HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG)). occurred