teaches you to publish Silverlight bussiness application (SQL Server login, LAN access, and issues needing attention with ArcGIS Server service)

Source: Internet
Author: User
Tags silverlight visual studio 2010

Original: teach you to publish Silverlight bussiness application (SQL Server login, LAN access, and issues needing attention with ArcGIS Server service)

Before the Silverlight application was released, there was no impediment to the direct use of the publish features of Visual Studio 2010, and nothing seemed to be set. Later re-install the system, there is no, these two days to help a big brother to do a few small examples, by the way integrated a bit. So idle to be bored to publish, the results of the eldest brother to fix, so good record again, so that the next review.

Before we start you need to install IIS 7.5,visual Studio 2010,sql Server 2008, this is the environment that this article tests, the other authors have not tried, so it is not very clear. The following is the author of the process of publishing and problems encountered.

You may need to do the following before you begin:

    1. Install. NET and register with the server (you can generally skip this step, if you are vs 2010, you should register the 4.0. NET Framework by default)

Example: C:\windows\microsoft.net\framework\<.net version number > \aspnet_regiis.exe-i

the specific version can view the Silverlight application's configuration file, for example:   

  <debug= "true"  targetframework= "4.0"/>

2. Enable WCF Ria Service.msi on the server side (optional, post bussiness application will automatically copy the required DLLs after installing the WCF Ria Service, as explained later)

To download the Riaservices.msi, install it using the following instructions:

msiexec/i Riaservices.msi Server=true

3. Place the cross-domain file in the root directory

Let's assume that your Silverlight application is not a problem and ready to publish. Let's start with our first step.

1. See a folder on your hard drive to store your published website. For example: Build a website folder on 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, then click Web Project, select Publish

Note: If you don't have the WCF RIA Service enabled on the server side without the beginning of this article, you'll need to take one more step here.

You need to set the following three references to true before you publish the Silverlight app CopyLocal

System.ServiceModel.DomainServices.Hosting

System.ServiceModel.DomainServices.Server

System.ServiceModel.DomainServices.EntityFramework (add Domainservice will have this reference), as shown, right-click the corresponding DLL to set:

Select File System in the pop-up configuration window and set the target location to the path of the new folder above us, as shown in:

then click Publish.

Then open IIS Manager

Right-click Site, select Add New site

Set the site name in the Add site, and the physical path (here you select the folder we created earlier: D:\MyWeb site, because in the previous step we publish the Silverlight application into this folder)

Then click OK, this time our esri_site should be shown as follows:

Then right-click the Esri folder and select Convert to Application.

Click OK in the pop-up window

At this point, the IIS view should resemble the following:

You can then click on the right side of the browser to view your app.

In general, there are no problems with browsing, there are a few issues to be aware of here:

1. When referring to ArcGIS Server services, you need to pay attention to the address of the service, not with localhost or computer name, all with an IP address instead.

2. When it comes to logging in to a database, you need to be aware of the authentication methods that IIS enables, and the authentication methods that SQL Server enables, or "apppool\xxx cannot be logged on", which can be done as follows:

The forms authentication is enabled by default in Silverlight, so IIS authentication is also enabled in IIS, click Applications-select authentication, as set out below:

3. Set the setup application pool to 4.0

Click Esri_site (Application pool used by Silverlight app), click Advanced Settings

Select 4.0

Note: When "apppool\xxx" fails to log in, it is found that there are two solutions, first of all:

1. Set the application pool's process model to LocalSystem

2. Modify the database connection in the Silverlight application, add the User ID and password in the connection, for example this is the connection used in this article:

<name= "DefaultConnection"  connectionString= "Data source=qzj-pc;i Nitial Catalog=iback; Persist Security info=true; User Id=sa; Password=quzijing "  providerName=" System.Data.SqlClient "/>

3. If the LAN is inaccessible, the firewall needs to be shut down (when I test it, I find that I can't access it when I start WIN7 the firewall)

Summarize:

IIS needs to be aware of the issue:

1. Note Registration. ENT Framework

2. Registering the WCF RIA Service service (or setting the Copy Local property of the associated DLL to TRUE)

3. Note the authentication method of the application, generally open forms Forms authentication and anonymous authentication.

4. Note The settings for the application pool

5.SQL Server authentication method, database connection problem, can be resolved by setting the connection string

6. When using the ArcGIS Server service, J changes the computer name to an IP address because the reference space error occurs if the map cannot be loaded.

7. If the above is not a problem, but still cannot access, try to shut down the firewall.

8. For the configuration and issues related to WCF service Publishing, refer to here:

Http://blogs.msdn.com/b/saurabh/archive/2010/03/16/ria-services-application-deployment.aspx

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.