Precautions for configuring asp.net in IIS during my exploration process, iisasp.net

Source: Internet
Author: User

Precautions for configuring asp.net in IIS during my exploration process, iisasp.net

"It is incorrect to use the Section registered as allowDefinition = 'machinetoapplication' outside the application level. This error may occur if the virtual directory is not configured as an application in IIS. "

I want to modify the web. config file to solve (modify the suffix, do not delete), because the web. too many configurations, and the iis website will generate a web when it is running. config, conflicts will occur. Of course, you can try the other solutions. I have also tried to add a virtual directory before.
Notes:
When deploying a website, you 'd better put the website project under wwwroot!
We need to specify the correct physical path to which IIS points! Otherwise, a series of problems may occur, such as the analyzer problem-analyzer error message: the file "/iis_1. _ Default" does not exist.

 

Iis configuration website
If there is no distinction between project folders, for example:

Create a simple mvc website (figure 4) and add a website directly to iis. Enter the directory in the VS directory (usually the directory is the same as the pakage folder, previously, I was worried that an error would occur if I didn't include the pakage file. It turns out that I was wrong. We can simply enter the project path)

If the classification is performed (Figure 3 ):

Set the WebUI folder (that is, the folder containing Views) to the physical directory. the biggest difference between iis mvc configuration and webform configuration is the configuration of the default document. aspx of the asp.net webform project corresponds to a file and a view, while cshtml of asp.net mvc, it is just a view template, and its routing is determined by the action under the Controller. This is worth noting. Let's look at the handler ing under IIS:

From the comparison of the above two figures, we can see that the IIS handler ing module processes aspx directly. Compared with cshtml, IIS is NOTFOUND directly, which is very difficult. ASP. net mvc routing mechanism will deal with this. Therefore, when configuring MVC projects, we don't need to process the default documents, just hand it over to the relevant dll of the MVC routing module for processing.

In the database connection section of web. config, we 'd better use
ConnectionString = "server =.; uid = sa; pwd = XXXXX; database = SportStore ;"
This format prevents problems when deploying to the server (what is it? I forgot)

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.