Bob Avallone

Bob Avallone

  • NA
  • 1
  • 748

Using Com Objects from within a WCF Project

Mar 17 2016 10:27 AM

I needed to reference a Com DLL from within a Silverlight program. Since this is not allowed, I created a wcf service and put my reference to the Com in it. This idea seems to work fine when I ran my wcf service from my local machine but when I published the service to my server it failed to work. The error was “ Retrieving the COM class factory for component with CLSID {70F84577-ECE6-4031-BE1A-6458CB7DF69F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

This process runs on five different servers. I had this problem when I set this up on my first server. I was able to find a solution. There are two parts to the solution.

1) When I do the build of the msi for the wcf process I choose Target Platform x86. 2) When I install the msi on the server, the Application Pool should have Enable 32 bit application set to true.

This worked on the first three servers, but it is not working on the latest server. I don’t see any difference except when I go to install the msi, I need to right click on it and Install as Administrator. I don’t have to do that on the other servers.

My computer runs Windows 7; the server runs Windows Server 2012 R2 Standard.

Also you should know, I am able to call the same com object from a Windows Service on my server.