简体   繁体   中英

COM CLASS Library . ASP.net MVC DLL

Is there a way to make a COM or Interop work on IIS Server Deployed ASP.net MVC?

I created an MVC Site which have a reference to a custom maid Interop COM to a scanner machine.

It works on Debug mode on VS but, when I try to deploy it on IIS and access it. It gives me Retrieving the COM class factory for component with CLSID {3FEDB614-C25B-448C-AED3-2D38A6C95765} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

The Thing is, the dll it self is already installed on my Machine, I think it is working on debug mode cause the IIS from VS is running differently or because I have a reference of the DLL needed.

But in IIS Deployment. Error Occurs. Any Ideas?

My main goal here is, to run the site on a Local Network and everyone can communicate with that site that has the Scanner Installed on.

Easy Idea, but hard implementation for me. And I am not even sure, if the call that I am doing is going to be made in the Host, rather than the Client.

Looks like IIS application Bin folder doesn't have Interop dll, copy the Interop dll, it's named as Interop.[YourCom].dll . YourCom is nothing but original COM. So if the COM name is MyCom.dll , so Interop should be Interop.MyCom.dll . If it's working on Debug mode on VS, then it should be available in VS application Bin folder.

Prerequisite of Interop dll: COM should be register in same the system.

It ends up that, Even Registering it Manually, doesn't Help in my case, don't ask I HAVE NO IDEA WHY.

I resolve it by letting the VS studio Project Settings/Build Tab/ Register COM check mark do the Rest. But the trick is to Run VS in Administrator or you will have an error. Last step is right clicking the bin Folder and choosing add to project. Not really sure why it didn't work without it, because I am pretty sure it doesn't need to be in the current project since IIS will redirect anyway in the bin folder.

Interop name is already applied but like Maiti says, it is needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM