Foreword: recently will often modify the content of some Web site front-end, in order to facilitate communication with the UI and products, you need to modify the page in a timely manner to the test machine or local IIS. In order to familiarize yourself with some of the IIS applications, the project was published on local IIS, which encountered some problems that were now resolved and then recorded and left for later use.
Flowchart:
How to enable and configure IIS here is not much to say, the main want to record is in the trial run in the process of some of the problems encountered.
several key points for configuring IIS:
1.URL rewrite module, which used to be ISAPI filter function, later seems to be revised, are modular design. (URL rewrite download link)
The 2.asp.net MVC project has routing mechanisms, so there is no need to use the default document features and directory browsing capabilities in IIS.
3. Remember to check the. NET Framework version of the application pool, configured as a v4.0 version.
4. Authentication is generally not used, and IIS defaults to anonymous authentication.
three major problems
1. The test run does not normally access the Web site, the error is as follows:
Error summary
HTTP Error 403.14-forbidden
The WEB server is configured to not list the contents of this directory.
The main reason for the local project Web.config file error, missing line of code, the completion of the code is as follows:
<system.webServer>
<modules runallmanagedmodulesforallrequests= "true"/>
Attached reference Links: Point me
2. After this problem is resolved, run the newspaper again CS0016 failed to write an output file error, the problem here is that the corresponding group or user of IIS does not have access to the local folder C:\Windows\TEMP, and enters the Security tab of the Properties window of the Temp folder to modify.
3. From the project itself, the coverage is wide. I was confronted with two main questions:
3.1来 from the logic of the JS file, the use of the Documen.domain attribute, you can use this property to obtain the current URL of the server name or IP address, in order to determine whether the current user to run the site is legitimate.
3.2来 the settings for each URL entry in the Web site. Here is a background: When debugging online, the server name in the URL is generally "localhost: port number", while online will be replaced by the corresponding domain name, in order to modify the convenience, there are the following settings:
Web.config file:
<appSettings>
<!--domain name-->
<add key= "domain" value= "http://localhost:7676"/> <add
key= "Host" value= "localhost"/>
</appSettings>
In a static class:
public static partial class Webuihelper
{public
static readonly string dominurl = configurationmanager.appsettings["Domain"];
}
In a page:
@{
var hosturl = webuihelper.dominurl;
}
<a href= "@ (hosturl)/***/" >
Remember to modify the Web.config file when you publish it to IIS.
Conclusion
1. The whole stack of engineers is very powerful. Whole Stack engineer = basic knowledge of deep + Perfect machine model + computer network + all kinds of back and forth language.
2. Programmers who do not want to know the logic of the product cannot be a qualified engineer.