简体   繁体   中英

Getting 'Failed to add a service. Service metadata may not be accessible.' error when testing a WCF project

I was trying to test the WCF service using the SOAP UI. I was able to successfully run the service and debug the service using the SOAP UI, then, out of the blue, just by itself, without any code or config change, the service behavior changed, and was no longer able to test it

All of a sudden, once I would run the service, the strange popup would come up

在此处输入图像描述

And then it would display a strange error

Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata

在此处输入图像描述

I am honestly not sure why this popup would start appearing. I tried various things, such as killing IIS Express, rebuilding the solution, and specifying a concrete start page for a concrete service.

Any idea would be appreciated, and once again, everything was working earlier

The solution to this issue was rather strange. All that needs to be done is to highlight/select the cs file, NOT the svc.cs file like I was doing before

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