Favicon generator for ASP.NET Core
Place favicons in wwwroot and reference them in Razor layouts or _Layout.cshtml.
ASP.NET Core
Generate your favicon package first, then follow the steps below to integrate with ASP.NET Core.
Installation steps
- 1
Extract favicon files to wwwroot/ in your ASP.NET Core project.
- 2
Reference icons in Pages/Shared/_Layout.cshtml or Views/Shared/_Layout.cshtml.
- 3
Ensure StaticFile middleware is enabled (default in Web SDK templates).
- 4
For Razor Pages, verify ~/_Layout.cshtml includes the link tags below.
- 5
Publish and test https://yoursite.com/favicon.ico in production.
Code & configuration
Copy and adapt for your ASP.NET Core project
@* Pages/Shared/_Layout.cshtml *@
<link rel="icon" type="image/png" href="~/favicon-96x96.png" sizes="96x96" asp-append-version="true" />
<link rel="icon" type="image/svg+xml" href="~/favicon.svg" asp-append-version="true" />
<link rel="shortcut icon" href="~/favicon.ico" asp-append-version="true" />
<link rel="apple-touch-icon" sizes="180x180" href="~/apple-touch-icon.png" asp-append-version="true" />
<link rel="manifest" href="~/site.webmanifest" asp-append-version="true" />Pro tips
- Use asp-append-version="true" for cache busting on PNG/SVG assets.
- Blazor WebAssembly projects also serve static files from wwwroot/.
Files to deploy
favicon.icofavicon.svgfavicon-96x96.pngapple-touch-icon.pngandroid-chrome-192x192.pngandroid-chrome-512x512.pngsite.webmanifest