The Silverlight application has been released before, and you have not encountered any obstacles at the time. Visual Studio 2010's publish function is directly used, and it seems that no configuration is made. Later, the system was reinstalled, and there was no such thing. In the past two days, I helped a big brother to provide some small examples and integrated them. As a result, I tried to release it again, but it took the boss a week to get it done. So I recorded it again so that I could check it again.
Before we start, you need to install IIS 7.5, Visual Studio 2010, and SQL Server 2008. This is the environment tested in this article. Other authors have not tried it, so it is not very clear. The following describes the author's release process and problems.
Before you start, you may need to do the following:
- Install. NET and register it with the server (skip this step. If you are vs 2010, the. NET Framework of 4.0 should be registered by default)
For example, c: \ windows \ Microsoft. NET \ framework \ <. Net version> \ aspnet_regiis.exe-I
For specific versions, you can view the configuration file of the Silverlight application, for example:
<compilation debug="true" targetFramework="4.0" />
2. Enable WCF Ria service. MSI on the server side (optional) after the WCF Ria service is installed, the bussiness application will automatically copy the required DLL, which will be described later)
Download riaservices. MSI and run the following command to install it:
Msiexec/I riaservices. MSI Server = true
3. Place Cross-origin files in the root directory
1. Assume that your Silverlight application is ready for release. Next we will start our first step.
1. See a folder on the hard disk to store your published website. For example, create a website folder on disk D, and then see an ESRI folder under the web site file, for example, D: \ my Web site \ ESRI.
2. Open the Silverlight project, rebuild, click the WEB Project, and select publish
Note: If you have not enabled the WCF Ria service on the server as described in this article, you need to perform one more step here,
Before publishing a Silverlight application, you must set the copylocal referenced in the following three statements to true:
System. servicemodel. domainservices. Hosting
System. servicemodel. domainservices. Server
System. servicemodel. domainservices. entityframework (this reference is available when domainservice is added), as shown in, right-click the corresponding DLL to set it:
In the pop-up configuration window, select the file system and set the target location to the path of the folder we created above, as shown in:
Click Publish.
Then open the IIS Manager
Right-click a website and choose add new website.
In Add a website, set the website name and physical path (select the folder we created earlier: D: \ myweb site, because in the previous step, we moved the Silverlight application publish to this folder)
Click "OK". Our esri_site should be shown as follows:
Right-click the ESRI folder and select convert to application.
Click OK in the pop-up window.
In this case, the IIS view should be as follows:
Click Browse on the right to view your application.
Generally, browsing is okay. At that time, you should pay attention to the following issues:
1. When referencing the ArcGIS Server service, pay attention to the service address. do not include localhost or computer name. All IP addresses should be used instead.
2. when you log on to the database, you must pay attention to the authentication method enabled by IIS and the authentication method enabled by SQL Server. Otherwise, an error "apppool \ XXX cannot be logged on" may occur. You can perform the following operations:
In Silverlight, Forms authentication is enabled by default, so IIS authentication must also be enabled in IIS. Click Application -- select authentication, and set as follows:
3. Set the application pool to 4.0.
Click esri_site (the application pool used by the Silverlight application) and click Advanced Settings.
Select 4.0
Note: When "apppool \ XXX" cannot be logged on, two solutions are available:
1. Set the process model of the application pool to LocalSystem
2. Modify the database connection in the Silverlight application and add the user ID and password in the connection. For example, this is the connection used in this article:
<add name="DefaultConnection" connectionString="Data Source=QZJ-PC;Initial Catalog=IBACK;Persist Security Info=True;User ID=sa;Password=quzijing" providerName="System.Data.SqlClient"/>
3. If the LAN cannot be accessed, You need to disable the firewall (I found that the firewall cannot be accessed when I started the win7 firewall during the test, just close it)
Summary:
Notes for IIS:
1. register the. Ent framework
2. register the WCF Ria service (or set the copy local attribute of the relevant DLL to true)
3. Pay attention to the authentication method of applications. Generally, Forms authentication and anonymous authentication are enabled.
4. Pay attention to the application pool settings
5. SQL Server Authentication and database connection problems can be solved by setting the connection string
6. When using the ArcGIS Server Service, J will change the computer name to an IP address, because if the map cannot be loaded, a reference space error will occur.
7. If no problem is found, but the access is still inaccessible, disable the firewall.
8. For configuration and problems related to the release of the WCF Service, refer to the following:
Http://blogs.msdn.com/ B /saurabh/archive/2010/03/16/ria-services-application-deployment.aspx