Favicon Not Showing

I have a favicon in my ASP.NET project that’s not showing up. I have a masterpage located at ~/MasterPages/MasterPage.master that holds the favicon. My markup is as follows:

<link rel="shortcut icon" href="/favicon.ico" rel="nofollow noreferrer noopener" rel="nofollow noreferrer noopener" type="image/x-icon"/>
<link rel="icon" href="/favicon.ico" rel="nofollow noreferrer noopener" rel="nofollow noreferrer noopener" type="image/x-icon"/>

The favicon is located in the project root. The dimensions are 16×16 and it’s 32-bit depth. I’ve cleared my browser’s cache, rebooted and nothing is working. Any suggestions as to what I should do?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Try placing a ~ and set the link elements to runat=server

<link runat="server" rel="shortcut icon" href="~/favicon.ico" rel="nofollow noreferrer noopener" rel="nofollow noreferrer noopener" type="image/x-icon" />
<link runat="server" rel="icon" href="~/favicon.ico" rel="nofollow noreferrer noopener" rel="nofollow noreferrer noopener" type="image/ico" />

This also needs to be done in the <head> section of the page.

Method 2

Try to leave the type away, clear the browser cache and go to the favicon address manually and add some parameters to it. That should fix it. Maybe you could tell me your website address, then I will look, if it shows up here.

Method 3

Right click on the solution and go to Properties. Under Application > Resources change the default icon to your chosen one.

Method 4

Load up fiddler
http://www.fiddler2.com/fiddler2/
and look for the request from the browser for it – that will show you if its successful, a cache issue, etc.

Method 5

In a .NET Core app (MVC template) try moving the favicon.ico file to the lib folder instead of the wwwroot folder.

Method 6

I finally solved this problem by renaming favicon.ico to myicon.ico, and reference it in the head <link rel="icon" href="~/myicon.ico" rel="nofollow noreferrer noopener" type="image/x-icon" />

Method 7

I used this method in ASP.NET:

<link rel="shortcut icon" type="image/ico" href="~/favicon.png">


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x