. NET Framework 4.0-based solution deployment

Source: Internet
Author: User

After vs 2010 was released, the following framework versions were upgraded to. NET Framework 4.0. I believe many of my friends are using it. This articleArticleIt summarizes how to deploy solutions Based on. NET Framework 4.0.

The reason is that this version is indeed different from the previous. NET Framework 2.0, 3.0, and 3.5. We also explored some time while using it. Therefore, we can summarize it for your reference to avoid detours.

 

Important:
    1. . NET Framework 4 and earlier versions can be parallel, and they do not interfere with each other. That is, you do not have to install any other version before installing. NET Framework 4. (The premise is that you just want to run the. NET framework 4Program)
    2. Many of my friends are most confused that if. NET Framework 4 is installed, can the previous software run (for example, Based on. NET Framework 2? The answer is: no
    3. Because of this parallel situation, you should pay special attention to setting the ASP. NET engine version on the server.
    4. . NET Framework 4 supports Windows XP and Windows Server 2003. Earlier versions of Windows 2000 or later are not supported.
    5. . NET Framework 4 websites cannot be deployed in Windows XP. In other words, Windows XP can only be used as the client, because the IIS in XP is 5.1, And the IIS version required by. NET Framework 4 is at least IIS 6.

 

Deployment prompt:

1. First download the relevant Installer

Net_framework_4.0installer.rar

This is the four software I have compiled (about 10 MB in total), as shown below:

    • Windowsinstaller-kb894263-v2-x86(3.1cmd.exe if you have not installed anything on your machine (whether on the server or client), you must first install this installer 3.1 to install the framework.
    • Wic_x86_enu.exe if your machine is XP (usually a client. before net framework 4, you need to install this WIC (Windows Image component). Don't ask me what it is for, I don't know, haha
    • Reportviewer2010.exe if your application uses the report viewer, you need to install this
    • En_.net_framework_4_full_web_installer_x86_x64_ia64_516530.exe is a Bootstrap program for installing. NET Framework 4 online. Make sure the network is smooth.

Of course, if you want to download the framework installation package in advance (for example, you cannot connect to the network in your customer scenario), proceed with the following operations:

    • If you want to download the complete installation package, visit here http://www.microsoft.com/downloads/details.aspx? Familyid = 0a391abd-25c1-4fc0-919f-b21f31ab88b7 & displaylang = en
      • The installation package is about 48 MB, which should be acceptable. It's not as scary as the original. NET Framework 3.5 (it seems that it's nearly 200 MB at that time, and the customer crashes directly)
    • If you want to download. NET Framework 4 client profile, access the http://www.microsoft.com/downloads/details.aspx here? Familyid = e5ad0459-cbcc-4b4f-97b6-fb17111cf544 & displaylang = en
      • The installation package is about 41 MB, which is about 7 MB different from full. I personally think this is no better. If the client profile is selected, some functions are unavailable. In fact, the more important thing is that you do not know what can be used and what cannot be used (there are some documents to introduce their differences, but who has the time to remember so many differences ). Therefore, we use full to avoid any trouble.

 

2. General server deployment process

Client deployment is relatively simple. You only need to install some of the above software, basically there will be no problem, the program can run. But the server is not that easy. Assume that you have a web application to deploy.

 

First, how do I package this web application? In this regard, vs2010 has made some good improvements. It can be directly released and packaged into a so-called package, as shown in the following menu

After packaging, a package directory is created under the OBJ directory of the project and under the DEBUG directory. You can see the following files.

 

Second, how do I deploy this web application on the server?

Copy all the preceding package directories and send them to the server administrator. How can the server administrator deploy the application? He has several methods.

The first method is to use the MS deploy tool.

Http://www.iis.net/download/webdeploy

This tool is provided by Microsoft for IIS 6 and IIS 7 and can be conveniently deployed. You can download it from the address above. (It is worth mentioning that the. NET Framework 2.0 SP1 must be installed on the current server before the tool is installed)

If the installation is complete, we will see some minor changes after enabling IIS.

As you can see, there is a "deploy" menu on the website, which contains several menu items. Now we can click "Import Application"

First, we need to specify the location of the deployment package, which is the ZIP file.

Note: you can modify the connection string here.

[Note] because we have detected that we are a. NET Framework 4 Web application, we will be prompted to select the application pool as. Net 4.0. Of course, we do not hesitate to click "yes"

The installation will soon be completed. What did it do? In fact, it will copy the file to wwwroot.

However, it should be noted that it randomly selects an application pool of. NET Framework 4.0, such as on my machine.

Sometimes, we may find that the program cannot run, for example

Experience tells us that most errors 503 are related to the application pool.

I tried to restart the program pool and the problem persists.

Then, I found that the special feature of this program pool is that its managed pipleline mode is integrated. Is there a problem?

I tried to select an application pool whose managed pipleline mode is classic, for example

Refresh the page to run my application.

At this point, we have completed the deployment of server-side applications. In this drill, we used the MS deploy tool. But in fact, tools are the same. Just remember the following two points

1. The application pool should be based on. NET framework 4

2. Choose classic as the managed pipleline mode of the application pool.

 

Finally, another possible problem is that if your application connects to the database, and the database connection string is written as follows:

Data Source =. \ sqlexpress; initial catalog = northwind; Integrated Security = true

One thing you need to know is that because you are integrated security = true, the identity used for database access is the ID of the application pool. Obviously, you need to ensure that the identity has the permission to access the database.

[Note] for accessing local servers and databases, you can directly set it to LocalSystem for simplicity. This special account can certainly access the database.

Of course, a more rigorous approach is to specify a specific account, which is granted access permissions for a specific database.

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.