For the first time deploying Silverlight to IIS6 to develop enterprise-level applications, some problems may occur. In order to avoid detours, some common problems are summarized. Generally, there are solutions to these problems on the Internet.
Focus on the following issues.
Ø cross-origin problems
Ø
Unable to display normally when Silverlight is deployed to IIS6
Ø
Access permission for the file WCF Service corresponding to the IIS virtual directory
1. Cross-origin problems
1) add files under the WCF root directory:
Clientaccesspolicy. xml
<? Xmlversion = "1.0" encoding = "UTF-8"
?>
<Access-policy>
<Cross-domain-access>
<Policy>
<Allow-fromhttp-request-headers = "*">
<Domainuri = "*"/>
</Allow-from>
<Grant-to>
<Resourcepath = "/" include-subpaths = "true"/>
</Grant-to>
</Policy>
</Cross-domain-access>
</Access-policy>
2) Placement in a Wcf Project
2. Silverlight
Use WCF RIAServices in IIS6
Deployment Problems
1) Silverlight cannot be properly displayed
, Right-click the virtual directory and choose Properties> HTTP header> MIME type. Add
Extension:. xap
MIME Type: application/x-silverlight-app
Extension:. xaml
MIME Type: application/xaml + xml
3. access permissions for the WCF Service corresponding to the IIS virtual directory
Whether it is Silverlight + WCF or Silverlight + ria wcf mode.
The network service user must be added to the WCF deployment file directory, as shown in:
Otherwise, cross-origin access problems may occur.