4

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!

Gonçalo Bastos
  • 376
  • 3
  • 16
  • 2
    Google for this guid a9e69610-b80d-11d0-b9b9-00a0c922e750 (CLSID_MSAdminBase) . This is related to your IIS install (not installed, not started, needs repair, etc.). – Simon Mourier Oct 26 '21 at 05:12
  • See this case, [Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154](https://stackoverflow.com/questions/1036856/retrieving-the-com-class-factory-for-component-with-clsid-xxxx-failed-due-to-t/3348181). It maybe helps you. – Jiale Xue - MSFT Oct 26 '21 at 06:58
  • Please share your ```webconfig``` file – MD. RAKIB HASAN Oct 26 '21 at 09:04
  • On what version of windows do you get this error? Also, is it a server or workstation? – Steeeve Oct 26 '21 at 15:42
  • Check this answer, Hope this will work. https://stackoverflow.com/a/7198157/13368495 – Nayem_43 Oct 30 '21 at 06:59
  • This can depend on what you are trying to do. You can improve this question by including code (Github link), your environment(os, .net version) – cdev Nov 01 '21 at 00:21
  • Sry but anything worked well! I think I need to format my computer – Gonçalo Bastos Nov 01 '21 at 22:27
  • I apply all latest update to visual studio 2022 through Visual Studio Installer, In "Visual Studio Installer" -> "Modify" -> checked "ASP.NET and web development" option -> and checked sub options such as "Window Communication Foundation", ".NET Framework 4.6.2-4.7.1 development tool". Problem resolved for my WCF service project lunched in Visual Studio 2022 – ChinaHelloWorld Feb 16 '23 at 14:14

1 Answers1

0

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).

MD. RAKIB HASAN
  • 3,670
  • 4
  • 22
  • 35