Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

asp.net mvc - Getting 404 error on MVC web-site

I have an IIS7.5 web-site, on Windows Server 2008, with an ASP.NET MVC2 web-site deployed to it. The website was built in Visual Studio 2008, targeting .NET 3.5, and IIS 5.1 has been successfully configured to run it as well, for local testing.

However, whenever I try and navigate to a page running in IIS7, I get a 404 error.

I have checked the following things:

  • There is no corresponding 404 log entry in IIS logs.
    • Actually, there are 404 entries in the IIS log.
  • The application pool for the web-site is set to use the Integrated pipeline.
  • The "customErrors" mode is set to off.
  • .NET 3.5 SP1 is installed
  • ASP.NET MVC 2 is installed
  • I've used MVC Diagnostics to confirm all MVC DLLs are being found.
  • ASP.NET is enabled in IIS, which we've demonstrated by running the MVC Diagnostics page.
  • KB 2023146 did highlight that HTTP Redirection was off, so we've turned it on, but no joy.

EDIT Ok, so we've installed the world's simplest MVC application (the one which is created when you create a new MVC2 project in Visual Studio), and we are still getting 404s on any page we try and access - e.g. <my_server>/Home/About will generate a 404.

Any ideas will be greatly appreciated!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is quite often caused by the following missing from the web.config:

<system.webServer>
   <modules runAllManagedModulesForAllRequests="true"/> 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...