Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net MVC - Why is a controller being created for favicon.ico?

I am using a custom ControllerFactory (to use Castle Windsor's IOC to create controllers), and I notice it's getting requests to create a controller for "favicon.ico". I have put a favicon.ico file in my Content folder, but I'm still getting these requests.

How do I resolve this and serve static content without trying to create controllers?

like image 549
ripper234 Avatar asked Dec 30 '09 07:12

ripper234


1 Answers

Add the following route:

routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
like image 70
Darin Dimitrov Avatar answered Nov 19 '22 18:11

Darin Dimitrov