Favicon Icon-MVC3 ASP.NET

What is the need for favicon.ico. I am trying to use MVC error handling and it complains about a missing file. How to get rid of this error.

thanks

+6
source share
4 answers

Go to the RegisterRoutes method of the Global.asax.cs file and add it as one of the first lines:

 routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" }); 
+19
source

I suggest you use it instead of getting rid of it. This is part of the web standards in user interface design. You do not like the branding of your site? Then this is a key part of this branding.

+2
source

Decision:

<link rel="SHORTCUT ICON" href="http://www.youraddress.com/youricon.ico"/>" If you use localhost, then href =" http: // localhost: port / youricon.ico "Note : use a different name instead of favicon.ico.

+2
source

Add the following to the beginning of your RegisterRoutes method:

routes.IgnoreRoute ("favicon.ico");

Your browser will always request a site for the icon, this ensures that mvc does not try to solve it.

+1
source

Source: https://habr.com/ru/post/892138/


All Articles