简体   繁体   中英

Silverlight Accessing WCF and CrossDomainAccessPolicy without IIS

I have a Windows Service that exposes a WCF service and so I'm not using IIS. I'm suddenly getting the famous SecurityException that mentions using a cross-domain policy when I try to access the service from a Silverlight app. However, since I'm not using IIS, does that mean I need to have a web server on the same port as my WCF service just to serve this file? Is there a better way to do it?

You can add another service with webHttpBinding (REST) that serves out ClientAccessPolicy.xml file. Then in your Windows Service, you can start that endpoint along with the other one so that Silverlight clients can get the cross-domain policy file. You can find more information in below links:

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