Local MVC project published to IIS server

Source: Internet
Author: User

0 nonsense

Friends sometimes we write a Web program that only uses Cassini server debugging, and below I teach you to publish to the IIS server (including local ISS7.5 and remote server

IIS)

1.VS Release

A. Click on Web Project, publish

B. Creating a new file, profile-

Select the file system in the connection and select the address where you want the file to be published

Settings, configuration: The following

Click Publish when Setup is complete

Publish a good Directory

B. Configuring IIS

0. You must start the site before you create it: W3SVC (World Wide Web Publishing Service) Services: Provides WEB connectivity and management through Internet Information Services Manager. The corresponding process: C:\Windows\system32\svchost.exe

1. Open IIS (Open with), add a new Web site to the website,

2. On the right, first start and then browse

If an HTTP error occurs 500-19-internal Server error

We see why: Configuration error because of insufficient permissions to read the configuration file (insufficient permissions, we give him permission)

FIX: Edit file permissions, select "XXX sites" node → right click → edit permissions → Join the Everyone account.

3, then continue browsing error HTTP Error 403.14-forbidden

Cause: The default document is not configured for the requested URL, and directory browsing is not enabled on the server.

Solution: Check the "xxx sites" node → See the right "features view" → Directory browsing → Click "Enable", "Disable" in the right window. It is not recommended to enable directory browsing

When directory browsing is not enabled, it is in ASP. To set up a default display page: Select the sites node → features view → default document → Double click → in the right dialog box, add a name for the document to be displayed by default, and move (move up, move down) to configure the route in MVC. You do not have to set the default page.

Change application pool, double-click your own web site project

Change the. NET Framework

4, you can access your website under normal circumstances,

5, other IIS error summary

(1) HTTP error 500.21-internal Server error

Error, Possible cause: 1>iis installation is incomplete. 2> does not register the. NET Framework on IIS.

Locate the corresponding. NET Framework directory, execute the aspnet_regiis.exe command, and re-register the. NET Framwork to IIS. The registration directory is as follows: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe-i (Installation)

Open the console (blank +shift) pop-up command window to register. NET Framwork to IIS

(2) Database validation error

Cause: The current Web site connects to the database using Windows authentication, and the account in the application pool that corresponds to the current Web site does not have access to SQL Server. Workaround: Change the authentication method of the Web Connection database to SQL Server authentication mode and log in with the SQL Server account.
(3) HTTP error 500.24-internal Server error

The program uses the Classic mode, the server is using the Integrated mode, the application pool of the corresponding website is selected, and modified to Classic mode.




(4) HTTP error 404.17-not Found

The server is inconsistent with the Web site program. NET version. Either the IIS installation is incomplete, or the. NET Framework (Error two) is not registered correctly.

3 Publishing to the server

Connecting to a server Win+r

Ibid. method configuration:

Note The MVC project appears when IIS7 is published: HTTP error 403.14-forbidden The WEB server is configured not to list the contents of this directory

Workaround: Change the Web site root directory. config file

Add to

<system.webServer>
<modules runallmanagedmodulesforallrequests= "true"/>
</system.webServer>

To set the value of the <modules> section to true;

4. Concluding remarks

This is my summary when the IIS release, if there is no solution to the problem can give me a message, I will try to help everyone!!!

Local MVC project published to IIS server

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.