Skip to content

Instantly share code, notes, and snippets.

@jpolvora
Last active Aug 29, 2015
Embed
What would you like to do?
Instrui o ASP.NET MVC a ignorar arquivos estáticos e ignorar algumas pastas, evitando erros 404 desnecessários.
/*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}");
@jpolvora

This comment has been minimized.

Copy link
Owner Author

@jpolvora jpolvora commented Oct 10, 2014

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment