Resolved Problem with adding favicon to blazor server

SaeedP

Well-known member
Joined
Oct 21, 2020
Messages
113
Programming Experience
3-5
Hello, I want to insert a link for the site favicon in the layout. C HTML, my link is:

C#:
<link rel="icon" type="image/x-icon" href="wwwroot/favicon.ico">

but I get this error:

Untitled1.png



But as you can see my favicon is in the wwwroot folder:

Untitled2.png


Do you think what is wrong? regards, Saeed
 
Solution
Did you read the error message? Look at the path. It's got "wwwroot" twice, which is obviously wrong. If you want one less "wwwroot" in that path, what do you think you ought to do to the path you provided? Seems like that should have been fairly obvious.
Did you read the error message? Look at the path. It's got "wwwroot" twice, which is obviously wrong. If you want one less "wwwroot" in that path, what do you think you ought to do to the path you provided? Seems like that should have been fairly obvious.
 
Solution
Amen; as j indicates, URLs on a deployed site are relative to the wwwroot folder, not the folder that contains the wwwroot folder

Also, you didn't close your link tag
 
Back
Top Bottom