maui
maui copied to clipboard
favicon.ico is not needed in MAUI Blazor Hybrid application
Description
When you create a new MAUI Blazor Hybrid application (both in .NET 7 and .NET 8 previes) a favicon.ico file is added wwwroot folder. This file is never visible (I think!), so it can be removed.
If it is removed, the embedded browser (at least in Windows) will try to load that file. But that can be prevent by adding this line in the header in index.html:
<link rel="icon" href="data:,">
Hmm interesting idea! We'll need to try this on each platform but it could be a nice simplification!
It's better be there for not having that annoying error in devtools console!
Failed to load resource: net::ERR_CONNECTION_CLOSED /favicon.ico:1
@mhrastegari, I don't get any such warning if I have <link rel="icon" href="data:,">. Only if I have no rel="icon" at all.
Verified this issue with Visual Studio Enterprise 17.10.0 Preview 1. After deleting favicon.ico/favicon.png in .NET 7 and .NET 8 projects, I don't get any errors and can debug normally.
Fixed in #23615