Thursday, December 6, 2012

The controller for path /favicon.ico does not implement IController

In an application using Controller factory, i encountered an error as stated in the title. My MVC does not have a favicon.ico. The solution is to add a parameter constraint that does not allow .ico filenames in your routes. I got the solution from forums.asp.net
Code:
 routes.MapRoute(  
           "Default",                       // Route name  
           "{controller}/{action}/{id}",              // URL with parameters  
           new { controller = "ProductView", action = "Index", id = "" }, // Parameter defaults  
           new { controller = @"[^\.]*" }    // Parameter constraints (regex/string expression)  
         ); 

0 comments:

Post a Comment