Search code examples
asp.netasp.net-mvcfaviconunhandled-exception

Controller factory receiving request for "favicon.ico"


I've noticed that a request to "favicon.ico" is being passed to my ASP .NET MVC controller factory when using Google Chrome and the Visual Studio Development Server. The controllerType parameter has a value of null which is unsurprisingly resulting in an unhandled exception, which I only know about because of an error log.

Any ideas where the request is coming from and why ASP .NET is letting it get to the controller factory? CSS files and images for example are being correctly filtered out.


Solution

  • With IIS7 in integrated mode all requests are tunneled to the pipe. you can add it to your ignore routes

    asp.net mvc does it handle all requests? - iis 7 integrated mode

    Another resource

    http://weblogs.asp.net/gunnarpeipman/archive/2009/02/26/asp-net-mvc-ignore-requests-to-favicon-ico.aspx

    Bear in mind to you only seeing this as you are in debug mode. Your users wont see it (Not optimal still, but hey I didn't design it)