After several successful Silverlight project calls to Web service, the following error occurs: "system. Security. securityexception: security error", as shown in:
Because I have only learned and tested the Silverlight functions in the past few days, and I have not made any formal projects, so I will re-build a project every time I see this. Today I am really impatient, the reason why I found it online is probably the cross-origin access permission of Silverlight. to create a "clientaccesspolicy. XML file, and thenCodePaste it to this file:
Code
<? XML version = "1.0" encoding = "UTF-8" ?>
< Access-Policy >
< Cross-Domain-Access >
< Policy >
< Allow-from HTTP-request-headers = "*" >
< Domain Uri = "*" />
</ Allow-from >
< Grant- >
< Resource Path = "/" Include-subpaths = "True" />
</ Grant- >
</ Policy >
</ Cross-Domain-Access >
</ Access-Policy >
Restart the applicationProgram, OK!