I know there is a solution to stop the mvc framework to process "favicon.ico" requests (solution), but i don't know why is it looking for this icon in the first place.
I searched using Find in Files > Entire Solution for favicon.ico
and nothing was found.
I searched in the html source code of the website for favicon.ico
and nothing was found.
Where is it? why the browser is trying to serve it?
favicon.ico is a convention - but is one way that the browser can get the image for links, tabs, etc:
Note that these days, the image location can also be set in metadata (which is handy as it allows the image to be per-page rather than per-domain, and/or allows for serving it from a different location, such as a CDN):
<link rel="shortcut icon" href="//cdn.sstatic.net/stackoverflow/img/favicon.ico">
<link rel="apple-touch-icon image_src" href="//cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
However, "/favicon.ico" is the fallback, and is used by many old browsers - or where no explicit shortcut icon is specified.
Basically: go create one.
You better have one since it is standard to most browsers to look for the favicon.ico however if you really don't want to have it and get rid of the error just add this line in your RegisterRoutes class.
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
Some browsers just look for favicon.ico in the root of your website by default.
I think the easiest way to stop the browser looking for this file is provide the image once, then the browser will cache it and stop asking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With