I cannot get ASP .NET MVC 4.0 to work when deployed on IIS 7.5 (Windows 7 x64) in Integrated Mode (or any other mode for that matter, but let's focus on Integrated Mode).
I am following these very simple steps
Create a new ASP .NET MVC 2 Web Application
Hit Run. It works.
Edit the project configuration to use my local IIS web server (http://localhost/MvcApplication1 - click Create Virtual Directory)
Hit Run. I get "The webpage cannot be found".
Pretty straightforward, right? It should work...but it doesn't.
The web application is runn开发者_开发技巧ing as DefaultAppPool (which is v4.0 Integrated pipeline mode, so no additional configurations should be required right?). Even so, I've tried creating a default wildcard route in the Handler Mappings configuration and that makes no difference.
Any ideas? Considering that MS has decided to internalize the entire resource location mechanism of MVC, I'm not sure what the best way of debugging this is...
Thanks.
I uninstalled HTTP Redirection, then reinstalled it, then ran regiis from both 32 bit and 64 bit framework directories and magically things started working as expected...
I had a similar problem. Maybe my solution will help someone else. In Viual studio I had a .cshtml file called ComingSoon (obviously a temporary page) and when the debugger started up it tried to route to Home/ComingSoon. The problem was, there was no ComingSoon method in the Home controller. I simply wanted to return ComingSoon view from the Index method. It worked fine when the debugger started from a place where the Home/Index would open (say on HomeController.cs or on the project itself) but would not work whenever the focus was on ComingSoon.cshtml. This is because Visual Studio, helpfully, tries to open the view you are working on.
So the solution was to add a ComingSoon method to the Home controller.
精彩评论