Asp. NET Web site publishing process detailed

Source: Internet
Author: User
This article mainly for the introduction of the ASP. NET program release detailed process, with a certain reference value, interested in small partners can refer to

Objective

Asp. NET Web site, whether it is a beginner or a master, in the process of publishing more or less there are some problems, such as the failure to publish ASP, IIS installation failed, IIS publishing failed, the LAN can not visit,

configuration file errors, insufficient permissions and a series of issues, combined with my lead the technical team of more than 500 people to respond to various issues, I spend some time today to summarize, convenient for everyone, common learning, common progress.

For further detailed analysis, I wrote a small demo, with the code attached. This is based on Vs2013,os for WIN10,IIS7 and other environmental explanations. (Other operating systems, such as WIN7, have similar principles, but with subtle differences)

1. Overall Solution Overview

2. Front-end

<%@ page language= "C #" autoeventwireup= "true" codebehind= "SessionDemo.aspx.cs" inherits= "Test.sessiondemo"%> <! DOCTYPE html>

3, Back-end

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 (Obje   CT sender, EventArgs e) {//session["a"] = "a";   Session["B"] = "B"; Response.Write (session["a"].   ToString ()); Response.Write (session["B").   ToString ());   String[] strsession = {"Wang Wenjia", "Zhao Wu", "Yang", "Bear"};   CreateSession (strsession);  GetSession (); } #region Custom Method//Create session public void CreateSession (string[] arrstr) {//create array string[] Str=new String[arrstr.len   GTH];    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 conversation public void Clearsession () {session.clear ();  }//End session public void Abandonsession () {Session.Abandon (); } #endregion}}

4. Test results

First, ASP. NET program Publishing

1, open the solution with VS2013.

2. Select the solution, click the right mouse button, and from the Pop-up dialog box, select Clean solution.

3. After the 2nd step "Clean solution", select "Solution", click "Right", and in the Pop-up dialog box, select "Rebuild Solution".

4, to the 3rd step "rebuild Solution" after the end, select the Web application, such as "Testdemo", click the Mouse "right", in the Pop-up dialog box, select "Publish".

5. Set the "Profile" node and click "Next".

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

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

8. Set the "Preview" node and click "Publish".

9, after the release of the file, such as the successful release of the file, after the successful release, click Open Folder, all pages of the. cs files are put into the bin inside.

Ii. installation of IIS

1. Open "Control Panel", select "Programs".

2. Select "Turn Windows features on or off" in the pop-up dialog box.

3. In the Pop-up dialog box, select "Internet Information Services" (if beginners, all options are recommended, for veteran, select On Demand), click "OK".

4, click OK, the system is using the changes.

5. After the application changes are completed, select "Restart Now". After the system restarts, the IIS configuration ends.

6. After restarting the computer, test the IIS configuration for success. In the Explorer Bar, enter "http://localhost", if the following interface appears, the IIS installation is successful.

Iii. IIS Publishing Web site

1. In the "I am Cortana, Cortana, have questions as far as possible ask me" enter the "Internet Information Services" input box.

2. Open the main IIS interface.

3. Select "Site", click the Mouse "right", in the Pop-up dialog box, select "Add Site".

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

5, at this time, the main IIS interface, "site" more than a site "Www.testWebSite", that is, just to get the name of the site.

6. Configure the application pool

7. Configuring the default Document

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

9, in order to prevent insufficient permissions, the file just released to add members "Everyone", and give permission. Right--Properties, security---Edit add

Enter "Everyone", which is the user assignment rights, OK.

10. Register IIS. Locate the upper case V in the program you are using, select Visual Studio, select Visual Studio Tools, select the VS2013 developer command prompt as an administrator, and go to CMD. Enter "Aspnet_regiis-i".

11, to this end, the entire release.

12, Test. In the browser address bar, enter: "Localhost:8090/sessiondemo.aspx", access.

13. At this point, the IIS publishing site completes the entire process.

Iv. configuration of IIS should be taken into consideration

1. Registering IIS Issues

Locate the upper case V in the program you are using, select Visual Studio, select Visual Studio Tools, select the VS2013 developer command prompt as an administrator, and go to CMD. Enter "Aspnet_regiis-i".

2. Lack of permission

Click on the VS published file, right--Properties----security-----add-on, input "Everyone"--Assign permissions for users, OK.

3, Firewall problems

LAN access is not, most because of firewall problems, if directly shut down the firewall, it is not safe, advocating the following solutions.

HTTP Service default Utility 80 port, only need to enable the HTTP service (80 port) in the firewall (pay special attention to the system's own firewall), if you use a different firewall, you need to do similar things.

A, start and all programs, management tools, Windows Firewall with Advanced Security, the left column of Windows Firewall with Advanced Security, select "Inbound Rules", select "New rule" in the right column, and the Popup

Select Port---Next, select TCP and a specific local port to fill in the port number you want to open (fill in 80; When you have the option to open all ports
Next, select Allow connection-Next, click Next, select all options, and then fill in the name (this is populated with IIS).

4. Detect if IIS is installed successfully

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

5, Port issues

The HTTP default port is: 80,iis when publishing, select a different port.

6, using the program pool, should choose the same as the site name, select the Integration method (when all the publishing is unsuccessful, you can classic and inheritance to switch back and forth test), select version V4.

7, vs Release, select Release version, instead of debug version, cut CPU Select any CPU.

8, in addition to the above problems, there are other problems, I will gradually update.

Thank you for your reading, if there are shortcomings, welcome advice, common learning and common progress.

"Recommended"

1. asp free Video Tutorial

2. asp Tutorials

3. Eon the ASP Basic video tutorial

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.