Thank you, the problem is fixed.
problem with favicon on the blazor site
Hello,
I have made a site in blazor server.
Why is my favicon not displayed on the site, while when I run it in VisualStudio, it is displayed without any problem?
thanks
5 answers
Sort by: Newest
-
-
Timo Kinnunen 126 Reputation points
2023-05-29T18:17:49.37+00:00 Blazor web app create a my-logo.svg-file from your my-logo.png-file (1000 pixels x 1000 pixels or less) copy it here: <head> ... <link rel="icon" href="images/my-logo.svg"> </head>
-
Saeed Pooladzadeh 231 Reputation points
2022-11-24T13:51:46.737+00:00 As you can see favicon is in the wwwroot folder:
On this page:
https://www.daveabrock.com/2020/11/08/blast-off-blazor-update-head/
There is a content:Now, we can head over the RealFaviconGenerator site to upload our new icon. After adjusting any settings to our liking, it’ll give us a bunch of icons, which we’ll unzip to the root of our wwwroot directory.
In index.html in the wwwroot directory, add the following inside the <head> tag:
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel="manifest" href="/site.webmanifest"> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="theme-color" content="#ffffff">
Do you mean this?
If not, can you explain? -
AgaveJoe 26,136 Reputation points
2022-11-24T12:39:18.957+00:00 Your responses are not clear.
The browser looks for favicon.ico in the application root which is the wwwroot folder not wwwroot/site_icons.
Did you added a link element or changed how the static file handler works?
Also, you tagged this question as MVC and Web API but your question states this is a Blazor application.
-
Saeed Pooladzadeh 231 Reputation points
2022-11-24T12:09:18.103+00:00 Can you please explain about <link> element?
You mean what should I do?I just replace the new favicon with the blazor default one.