Silverlight 安全异常
Silverlight Security exception
当我 运行 在 Visual Studio 2013 下 Windows 8.1 中的 Silverlight 应用程序时出现以下错误。
Stack Trace:
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
我用以下内容创建了一个 clientaccesspolicy.xml 文件。我仍然得到同样的错误:
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
我需要添加任何更多设置,以免出现安全错误。
我发现我没有将 clientaccesspolicy.xml 文件放在正确的文件夹中,这导致了错误。
当我 运行 在 Visual Studio 2013 下 Windows 8.1 中的 Silverlight 应用程序时出现以下错误。
Stack Trace:
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
我用以下内容创建了一个 clientaccesspolicy.xml 文件。我仍然得到同样的错误:
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
我需要添加任何更多设置,以免出现安全错误。
我发现我没有将 clientaccesspolicy.xml 文件放在正确的文件夹中,这导致了错误。