Getting 404.0 error for ASP.NET MVC 3 app on IIS 7.0 / Windows Server 2008

前端 未结 6 2142
不思量自难忘°
不思量自难忘° 2020-12-24 13:18

I am attempting to deploy an ASP.NET MVC 3 application to a Windows 2008 x64 server (running IIS 7.0 obviously), and IIS does not want to seem to serve up the content proper

6条回答
  •  佛祖请我去吃肉
    2020-12-24 13:51

    You actually just reminded me that I needed to fix this issue in an enviroment here. If your situation is the same as mine then it's a simple fix.

    Just add the following to your web config:

    
        
    

    Edit: To provide further explanation on the issue at hand. In my case what was happening was when I added custom route mappings IIS was seeing the requests as Folder/Static File requests and thus was skipping over the ASP.NET worker process. This behaves differently under development environment generally because it is being run under the development web server which will also pass all requests through the .net process.

    This Web Config entry tells IIS that you have modules that should be run on every web request even if IIS determines it to be a static file or a folder.

提交回复
热议问题