When deploying ASP. net mvc applications under iis6. MVC is based on ASP. NET. By default, the Framework checks whether physical files exist in the physical path for any request. If yes, it does not use the MVC routing mechanism. Otherwise, it will only walk.
Therefore, if you do not consider controlling static resource permissions, you can set static resources to be directly processed by IIS instead of ASP. NET's ISAPI. This method improves some performance. This topic describes the deployment process.
0. When designing an MVC website, place static resources in a folder. We recommend that you use lowercase letters for the directory structure.
1. publish a web application to a specific path (omitted) (by the way, MVC2 functions are weaker than MVC3, and few components are used. You can directly deploy System in a private mode. web. mvc; but MVC3 has more features and the Razor engine, and more dependent components. We recommend that you install MVC3 directly during deployment)
2. Create a web site (omitted)
3. Right-click the created web site, select properties, and switch to the Home Directory page.
4. Click Configuration. In Wildcard application maps, click Insert to add C: WINDOWSMicrosoft. NETFrameworkv4.0.30319aspnet _ isapi. dll. deselect Verify that file existsg. (If MVC2 is used, you can go down to 2.0 to find this dll. The key is to remove the verification of static files, which enables asp.net to process all requests)
5. Click OK.
6. Allow ASP. NET 4.0 Extension
7. The content directory is the directory where static resources are placed. You can set the content directory to directly process requests by IIS to improve performance. Right-click content and select Properties.
8. Click create, and then click configuration to remove content under Wildcard application maps. Click OK. Here, a bug in IIS is used to set the directory to a virtual directory and delete the settings of Wildcard application maps. In this way, requests for this virtual directory are directly processed by IIS.
9. Click Remove to restore the virtual directory to a normal directory. In this way, only files in this directory will be "favored" by IIS"
10. Set the AppPool permission. Click the AppPool attribute used by the site, switch to Identity, and select Local System. This is a lazy setup method to prevent the application from having insufficient access permissions to the system.
11. Set anonymous access permissions. Right-click the site and select the permission. Click Add ..., In the displayed dialog box, enter IUSR_XXX (XXX indicates the machine name ).
Click OK to add an Internet Guest Account and retain the default read-only permission.
12. Note that if you install. NET 4.0 for the first time, do not forget to register
In-depth understanding of ASP. net mvc (2), discussed the routing mechanism of the MVC Framework, which mentions that "you can set RouteExistingFiles of RouteCollection to true to make the route does not match static files (note that true is not matched, this name is strange )." Therefore, we can set this so that MVC does not check static files, which can improve performance. The final request will be serve like that