problem with favicon on the blazor site

Saeed Pooladzadeh 241 Reputation points
2022-11-24T11:20:58.617+00:00

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?

263874-bla.png

thanks

Developer technologies ASP.NET ASP.NET Core
Developer technologies .NET Blazor
Developer technologies ASP.NET Other
{count} votes

2 answers

Sort by: Most helpful
  1. 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>
    
    
    1 person found this answer helpful.

  2. AgaveJoe 30,126 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.