This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17299|Reply: 0

[ASP.NET] asp.net Directory Listing Denied workaround appears on mvc websites

[Copy link]
Posted on 11/19/2015 5:48:21 PM | | | |

Everyone is familiar with configuring websites in IIS, and I don't think there are many brothers who don't, but when configuring asp.net MVC, there will be some problems. I will record the problems I encountered during the configuration for your reference.

My unit's server is Windows 2003 system, IIS6


Directory Listing DeniedThis Virtual Directory does not allow contents to be listed.

      This is because you are missing a dll file,

       Select Site - > Properties -> Home Directory -> Configuration -> Mapping

        

        Insert the Wildcard Application Mapping below in the selection

        C:WINDOWSMicrosoft.NETFramework 2.0.50727aspnet_isapi.dll

        Note here that

        

       Confirm if the file exists this checkbox, never select why. Because in the IIS 6,7 version, he doesn't recognize the path settings in our Routing



We generally are

  1. public static void RegisterRoutes(RouteCollection routes)            
  2.     {                  
  3.      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");                  
  4.      routes.MapRoute(                       
  5.      "Default", // Route name                       
  6.     "{controller}.aspx/{action}/{id}", // 大家看好,如果你选择了上面的复选框,这里你就得加上文件的扩展名,不然的话,会提示你,文件不存在         
  7.      new { controller = "Home", action = "Index", id = ""}// Parameter defaults                  
  8.      );            
Copy code

Just change the above program mapping dll to .NET 4.0!






Previous:SQL Prompt installation tutorial
Next:c# Connect to the Mysql database
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com