Last active
August 29, 2015 14:07
-
-
Save jpolvora/6e1306dcd384be56ee59 to your computer and use it in GitHub Desktop.
Instrui o ASP.NET MVC a ignorar arquivos estáticos e ignorar algumas pastas, evitando erros 404 desnecessários.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Global.asax.cs ou RouteConfig.cs*/ | |
var routes = RouteTable.Routes; | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(?i)(asp|aspx|css|js|xml|txt|png|gif|jpg|jpeg|bmp|ico|woff|svg|ttf|eot)(/.*)?" }); | |
routes.IgnoreRoute("Content/{*pathInfo}"); | |
routes.IgnoreRoute("Scripts/{*pathInfo}"); | |
routes.IgnoreRoute("Bundles/{*pathInfo}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System.Web.HttpException (0x80004005): The controller for path '/favicon.ico' 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.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)