Here's the situation:
- ASP.NET MVC 3 application using Razor as a viewer.
- Works fine under Visual Studio Development Server (Cassini)
- However, when I switch to "Use the local IIS web server", the site functions, but each static resource is 404s (again, there were no problems in Cassini).
- ASP.NET 4.0, Windows 7 Ultimate x64, IIS 7.5, Integrated Pipeline, Network Service as an application pool identifier.
In particular, an exception for trying to access a static file that is known to exist (for example, delete application files, in particular DLLs with route information, etc., and are serviced without problems). Again, this happens for all static files, including ie / public / scripts / jquery.js:
Error in path: /favicon.ico Raw URL: /favicon.ico Message: Path '/favicon.ico' not found. Source: System.Web Stack Trace: in System.Web.HttpNotFoundHandler.ProcessRequest (HttpContext context) in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute () in System.Web. step.Expute.Expute.Expute.Expute.Expute.Expute.Exepute.Exepute.Exepute.Exebute.Exepute.Exepute.Exepute.Exepute.Exepute.Execute.Exepute.Exepute.Execute.Exepute.Exepute.Exepute.Exepute.Execute.Exepute.Execute.Exepute.Exepute.Exepute.Execute.Execute.Execute.Execute.Execute.Execute.Execute.Execute.Execute.Execute.Execute.Exepute.Execute.Exepute.Execute.epec. IExecutionStep, Boolean & completed synchronously) TargetSite: Void ProcessRequest (System.Web.HttpContext) NLogLogger.Fatal => NLogLogger.Fatal => LoggerImpl.Write
I am puzzled. I checked that the default ASP.NET MVC 3 test application works fine on both the VS Development Server and the local IIS web server on this computer.
I hope someone else runs into a similar problem. In case this helps, here are my routes:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("favicon.ico");
routes.MapRoute(
"Login",
"login",
new { controller = "Session", action = "Create" }
);
routes.MapRoute(
"Logout",
"logout",
new { controller = "Session", action = "Delete" }
);
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}