RouteExistingFiles与ASP.NET和IIS静态文件问题

时间:2014-03-22 20:44:51

标签: asp.net-mvc-4 iis-6

我有ASP.NET MVC 4应用程序,并已将其部署到Windows 2003 IIS6。我将通配符设置为C:\ WINDOWS \ Microsoft.NET \ Framework \ v4.0.30319 \ aspnet_isapi.dll。

当我设置routes.RouteExistingFiles = false时一切正常。但是当我更改为真实图像文件时返回404错误。

<!-- 
[HttpException]: The controller for path &#39;/images/spinner.gif&#39; was not found or does not implement IController.
   at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
   at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->

在IIS7上,它在两种状态下均可正常工作。

任何帮助将不胜感激。感谢。

0 个答案:

没有答案