This topic describes the steps you must perform to deploy your WCF RIA Services application to a Web server.
Confirm that the .NET Framework 4 Platform is Installed on the Web Server
The .NET Framework 4 must be installed on the Web Server for a RIA Services application to work.
Install RIA Services on the Web Server
The RIA Services assemblies must be available on the Web Server. You can make them available on the Web Server by either including them in the Bin folder of your project or by installing them in the global assembly cache (GAC).
- Bin Deployment - when deploying your application, you can include the RIA Services assemblies in the Bin folder of your project. To do this, you must select in Visual Studio each reference that you want to include and must set the Copy Local property to True. After setting this value to True, the assemblies will be copied to the Bin folder the next time you build the solution. When the assemblies are copied to the Bin folder, they will be copied to the Web server when you publish the site.
- GAC Deployment - instead of copying the RIA Services assemblies in the Bin folder of every project that uses them, you can install the assemblies in the GAC. Any assemblies in the GAC are available to every application on the server. This approach is easier to maintain because an assembly only needs to be updated in the GAC instead of every Bin folder.
To install the RIA Services assemblies in the GAC on a Web server, run the following command.
msiexec /i RiaServices.msi SERVER=TRUE
Install Telerik OpenAccess ORM on the Web Server
The Telerik OpenAccess ORM assemblies must be available on the Web Server. You can make them available on the Web Server by either including them in the Bin folder of your project or by installing them in the global assembly cache (GAC).
Check Configuration Values
By default, all of these values are set in the Web.config file when you create a RIA Services solution in Visual Studio. If you deploy this Web.config file with any necessary changes to move from your development environment to the production environment, your RIA Services solution is properly configured. However, if you must retain an existing Web.config file, you will need to integrate the values for RIA Services. These values include the aspNetCompatibilityEnabled setting, the target framework, and the domain service definitions.
To set the aspNetCompatibilityEnabled property to true, include the following element in Web.config:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
To set the target framework to 4.0, include the following element:
<compilation targetFramework="4.0" />
To define the domain service module, specify it in the <httpModules> and <modules> elements:
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="DomainServiceModule" preCondition="managedHandler"
type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
If you are using "Integrated Security=True" in your connection string for your "LocalSqlServer" connection (the connection to the database that your authentication service is using), then it is possible to have security issues when deploying your Silverlight application. When you are running the Silverlight application under Visual Studio 2010, the personated user is you, the current windows login user. But when you deploy the Silverlight application to IIS, unless you set a valid windows user as the user that your Application connects as, the personated user is the Network Service. In this situation there are two possible solutions:
- Add login for the "NT AUTHORITY\NETWORK SERVICE" to your server. After that give permissions for "NT AUTHORITY\NETWORK SERVICE" to the target database.
- Change the connection string to use SQL authentication instead of Windows authentication.