4
votes

I"m trying to connect my Silverlight application to a WCF service that I'm hosting myself. I've created a clientaccesspolicy.xml file, and placed it in the service host project's root, but when I try to hit the service, my http sniffer says it can't be found. Specifically the file it's looking for is http://localhost:8080/clientaccesspolicy.xml.

I'm running the server and the silverlight app in debug mode in Visual Studio 2010. Do I need to put the file somewhere else?

2

2 Answers

3
votes

The clientaccesspolicy.xml file must be in the root of the domain where the service is hosted. You may already have it there but the virtual path of the web site or web application from the property page will need to be changed to "/"

See this page for more information.

2
votes

I did not understand how you're hosting your WCF service?

Is it hosted in a asp.net application or a windows host (self-hosting)? If the latter is the case, you may have to implement a clientaccesspolicy service that provides the content of the clientaccesspolicy.xml file on request.

For example like this.