Four ways to publish a ASP.net Web site to IIS

Source: Internet
Author: User
Tags anonymous file system

Four methods and considerations for publishing the ASP.net Web site to IIS:

Either way, the first thing to do is to have IIS support the ASP.net program, which is supported by the default IIS asp.net Web site program. In IIS, in Web service extensions, make sure that "asp.net v2.0.50727" is enabled. The other can remain disabled.

Publish Method 1:---Copied directly to the IIS Directory publishing directory (C:inetpubwwwroot)

A. Copy the folder of the ASP.net Web site project that is running on vs Debug to the Wwwroot folder in IIS.

B. Check the project folder's Properties---> Security, view the Internet Guest account, and make sure that it has Read permissions. (By default, folders copied to wwwroot inherit wwwroot Read permission, but when you modify the IIS home directory location, you often need to manually specify Read permissions)

C. After you refresh the Web site in IIS Manager, you will see the folder you just copied. In IIS, right-click the folder---> Properties---> Contents tab to ensure that read, record access, and index resource 3 items are selected.

Then click on the "Directory Security" tab and click "Edit" under "Authorization and access control" to make sure that "Allow anonymous access" and "Integrated Windows Authentication" are selected, and avoid changing the username and password of the anonymous account.

If you want non-index, default, Iistart and other names of the page to do the default homepage, but also in the "Document" tab, click on the "Enable default content document" Add, you want to do the first page of the file name added.

D. Go back to the Contents tab of the folder "Properties" and click "Create". (Scripts are required for scripting resource access, and "script-only" in Execute permissions)

Publish Method 2:---Publish using the Vs2008 IDE's own publishing feature.

A. In the ASP.net Web site project after vs debugging, right click on the website project, select "Post Site" and click "Target path" after the browser button (just that ... button), a Publish Web Site dialog box pops up.

B. In the pop-up dialog box, click "Local IIS" on the left, and then click "Create a new Web application" on the right-hand side of "explorer" (or click "Create a virtual directory"), enter the name of the application, and then go OK.

Publish Method 3:---Publish a Web site using a virtual directory.

A. In IIS management, click on the Default Web site (or your site), select "Right"---> "new"---> "virtual directory", then enter the alias in the pop-up dialog box, then select the path of the site project.

It is recommended that you copy the Web site project to the Wwwroot and create a virtual path, you can back up, and then no longer have to modify the permissions. As in other directories, you also need to specify file system permissions for the Web site project folder (for example, a in Publication Method 1)

B. After you choose to play the path, you need to check "run script" in addition to "read". then click OK.

Publish Method 4:---Use Web sharing in a folder share to publish.

a. Click "Right" on the Web site project folder, select "Sharing and Security", and in the dialog box that pops up, select the Web Sharing tab. After you select Share this folder, the Edit Alias dialog box pops up, and after you modify the alias, OK. (You can check the script options on Demand)

Recommendation: After you copy a Web site project to a directory, then perform Web sharing. For unknown reasons, execution in some folders cannot be successful, such as under a desktop folder.

Common check steps after IIS problems:

1. Check the "Web service extensions" to see if support for "ASP.net v2.0.50727" is turned on.

2. Open the folder where the Web site is located (such as: Wwwroot), in the properties---> Security, check for Internet Guest accounts, if not, and specify at least one read-only permission for them.

3. In IIS Admin, select the "Default Web Site" and click "Properties". In the home directory, check to see if read, record access, and index resources are selected. Again, in directory security, after clicking "Edit" under "Authorization and access Control", the view does not check "anonymous access" and " Integrated Windows authentication.

Check the ISAPI filter tab to see if it is empty.

If you set a page with a name other than index, default, and so on, check to add the file name you want to do on the first page of the "Enable Default Content Document" tab on the Documents tab.

4. Check the "Default Web site" below the application, right click on the corresponding application of your site, select "Properties", according to the above 3 requirements to check the "directory", "Directory Security" and "document" three options.

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.