Failed getting class factory de COM of component with CLSID {A9E69610-B80D-11D0-B9B9-00A0C922E750} error: 80040154 Class not Registered

Viewed 791

I am a student, and today on my class when I tryed to run a project with WCF Test client, the visual Sutdio 2019 retrieves me this error:

Error: Cannot obtain Metadata from http://localhost:54417/ServiceBookStore.svc 
If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  
For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://localhost:54417/ServiceBookStore.svc  

My teacher and I tryed to solve the problem, I had search for a solution but I didn't found too much things. I tryed to uninstall VS 2019 but didnt work so well

Print with error:

enter image description here

Thanks for any help!

1 Answers

It sounds like your service was built against Any CPU, causing you error on 64-bit where you are using COM components. You need to build it x86.

The application is probably running as a 32-bit process which is why it can use the component. Build your solution against x86 will force your service to run as 32-bit.

Open Visual studio > project properties > in the Build tab > platform target =X86

enter image description here


Another Solution:

Open Visual studio > project properties > Build > "Prefer 32-bit" uncheck this. (If it is checked).

Related