Configuring Deployment of Silverlight
It is sometimes necessary to configure Silverlight differently especially when using WCF services. I read this useful post by Mohamed Ibrahim Mostafa on how to configure the ServiceReferences.ClientConfig XML file to cater for different deployment environments. I found this most useful. As the post suggests the the XAP contains references to the ServiceReferences.ClientConfig XML file. But be warned when you are deploying to a host site the Client Bin folder (from which the XAP file is downloaded) must also have a copy of ServiceReferences.ClientConfig in it with the same references. Don’t really know why as it should be bundled in the XAP and don’t really know how I would be expected to guess that but I did. You must also remember to rebuild with the changes to the ServiceReferences.ClientConfig file prior to deployment to the Host site.
For local development
<configuration> <appSettings> <add key="Host" value="http://localhost:1420/" /> <add key="FileServiceEndPoint" value="http://localhost:1420/" /> <add key="ServerContentFolder" value="LocusPackages" /> <!--<add key="Host" value="http://Host.com/FTPFileServer/" /> <add key="FileServiceEndPoint" value="http://Host.com/FTPFileServer/" /> <add key="ServerContentFolder" value="LocusPackages" />--> </appSettings> </configuration>
For Host deployment 1) rebuild and deploy 2) keep this copy of ServiceReferences.ClientConfig on the Host Client Bin folder
<configuration>
<appSettings>
<!–<add key="Host" value="http://localhost:1420/" />
<add key="FileServiceEndPoint" value="http://localhost:1420/" />
<add key="ServerContentFolder" value="LocusPackages" />–>
<addkey="Host" value=http://Host.com/FTPFileServer/ />
<addkey="FileServiceEndPoint" value=http://Host.com/FTPFileServer/ />
<addkey="ServerContentFolder" value="LocusPackages" />
</appSettings>
</configuration>