Detailed ASP. NET program release process, asp.net program release

Source: Internet
Author: User

Detailed ASP. NET program release process, asp.net program release

Preface

ASP. NET website release, whether it is a beginner or a master, there will be more or less problems in the process of program release, such as VS publishing ASP. NET program failed, IIS Installation failed, IIS publishing failed, lan inaccessible,

Due to a series of problems, such as incorrect configuration files and insufficient permissions, I will take some time to summarize the problems that have been reflected by more than 500 technical teams. This helps you learn and make progress together.

For further detailed analysis in the following article, I wrote a small Demo with the code attached. This tutorial is based on VS2013, And the OS is WIN10 and IIS7. (Other operating systems, such as WIN7, have similar principles, but have minor differences)

1. Overall solution Overview

2. Front-end

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sessionDemo.aspx.cs" Inherits="Test.sessionDemo" %><!DOCTYPE html>

3. backend

Using System; using System. collections. generic; using System. linq; using System. web; using System. web. UI; using System. web. UI. webControls; using System. collections; namespace Test {public partial class sessionDemo: System. web. UI. page {protected void Page_Load (object sender, EventArgs e) {} protected void btnSesison_Click (object sender, EventArgs e) {// Session ["a"] = ""; // Session ["B"] = "B"; // Response. write (Session ["a"]. toString (); // Response. write (Session ["B"]. toString (); string [] strSession = {"Wang wenjia", "Zhao Wu", "Yang Xiong", "bear"}; createSession (strSession); getSession ();} # region custom method // create Session public void createSession (string [] arrStr) {// create an array string [] str = new string [arrStr. length]; for (int I = 0; I <arrStr. length; I ++) {str [I] = I. toString (); Session [str [I] = arrStr [I] ;}// traverse Session public void getSession () {IEnumerator sessionEnum = Session. keys. getEnumerator (); while (sessionEnum. moveNext () {Response. write (Session [sessionEnum. current. toString ()]. toString () + ";") ;}// clears the Session, but does not end the Session public void clearSession () {Session. clear () ;}// end Session public void abandonSession () {Session. abandon () ;}# endregion }}

4. Test Results

I. ASP. NET program release

1. Use VS2013 to open the solution.

2. Select a solution, right-click the solution, and select clear solution from the pop-up dialog box ".

3. After the solution is cleared in step 1, select solution> right-click and select "regenerate solution" in the displayed dialog box ".

4. After "regenerate solution" in step 2 is complete, select the web application, for example, "testDemo"-> right-click "-> In the displayed dialog box, select "publish ".

5. Set the "configuration file" node and click "Next ".

6. Set the "connection" node and click "Next ".

7. Set "Settings" and click "Next ".

8. Set the "preview" node and click "publish ".

9. For the published file, for example, the file is successfully published. After the file is successfully published, open the folder and put the. cs files on all pages into the bin.

Ii. IIS Installation

1. Open "Control Panel" and select "program ".

2. In the dialog box that appears, select "enable or disable Windows ".

3. In the pop-up dialog box, select "Internet Information Services" (if you are a beginner, select all. For veterans, select as needed) and click "OK ".

4. Click OK and the system is using the changes.

5. After the application changes, select "restart now ". After the system restarts, the IIS configuration is complete.

6. Restart your computer and test whether the IIS configuration is successful. In the browser bar, enter "http: // localhost". If the following interface is displayed, IIS is successfully installed.

Iii. IIS publishing website

1. Enter "Internet Information Services" in the "I am Cortana, Nana, and ask me if you have any questions" text box ".

2. Open the main interface of IIS.

3. Choose "website"> "right-click". In the displayed dialog box, select "add Website ".

4. In the displayed dialog box, set relevant parameters.

5. At this time, the main interface of IIS, "website" has an additional site "www. testWebSite", that is, the site name just obtained.

6. Configure the application pool

7. Configure the default document

8. After the default document is successfully added, as shown in:

9. To prevent insufficient permissions, add the published file member "everyone" and grant permissions to the file. Right-click and choose Properties> Security> Edit> Add

-> Enter "everyone"-> assign permissions to the user everyone-> OK.

10. Register IIS. Find the upper-case V in the program used, select "Visual Studio 2013"-> select "Visual Studio Tools"-> select "VS2013 developer command prompt" as an administrator to go to CMD. Enter "aspnet_regiis-I ".

11. Now, the entire release is complete.

12. Test. Enter "http: // localhost: 8090/sessionDemo. aspx" in the address bar of the browser to access the service.

13. At this point, the whole process of IIS website publishing has ended.

Iv. Precautions for IIS configuration

1. IIS registration problems

Find the upper-case V in the program used, select "Visual Studio 2013"-> select "Visual Studio Tools"-> select "VS2013 developer command prompt" as an administrator to go to CMD. Enter "aspnet_regiis-I ".

2. Insufficient Permissions

Click the target VS published file, right-click the file, and choose Properties> Security> Edit> Add> enter "everyone"> assign permissions to the user everyone> OK.

3. Firewall Problems

LAN access fails, most of which are due to firewall problems. If the firewall is directly disabled, it is not safe. The following solutions are recommended.

The HTTP service uses port 80 by default. You only need to enable the HTTP service (port 80) in the firewall (especially in the firewall that comes with the system). If you use other firewalls, similar operations are also required.

A. Start-> All Programs-> Administrative Tools-> Windows Firewall for Advanced Security-> on the Left bar of Windows Firewall for advanced security; select "inbound rules"-> select "new rule" in the right sidebar-> in the pop-up

Select one of the windows: Select Port> next> select TCP and specify the local port to be opened (enter 80 here; you can also select Open all ports
Next-> select allow connection-> next-> select all options-> next-> enter the name (here, enter IIS ).

4. Check whether IIS is successfully installed.

Enter http: // localhost in the browser URL. If the following interface is displayed, the installation is successful.

5. Port Problems

The default http port is 80. When IIS is published, select another port.

6. In the application pool, select the integration method that is the same as the website name (when both the publishing fails, you can switch back and forth between the classic and inheritance test) and select version V4.

7. When VS is released, select the Release version instead of the Debug version, and switch the CPU to any CPU.

8. In addition to the above questions, I will update them gradually.

Thank you for your reading. If you have any shortcomings, please kindly advise and learn and make progress together.

Thank you for sharing the information.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

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.