Skip to content

Add .webmanifest MIME type mapping to Blazor WASM web.config template#51025

Merged
javiercn merged 1 commit intomainfrom
copilot/fix-6072d044-02dc-4322-943a-a29a108f61aa
Jan 26, 2026
Merged

Add .webmanifest MIME type mapping to Blazor WASM web.config template#51025
javiercn merged 1 commit intomainfrom
copilot/fix-6072d044-02dc-4322-943a-a29a108f61aa

Conversation

Copy link
Contributor

Copilot AI commented Sep 26, 2025

Fixes issue where Blazor WebAssembly PWA applications deployed to IIS would encounter 404 errors when accessing .webmanifest files due to missing MIME type configuration.

Problem

When deploying Blazor WASM PWA applications to IIS, the generated web.config file was missing the necessary MIME type mapping for .webmanifest files. This caused IIS to return 404 errors when browsers attempted to fetch the web app manifest, breaking PWA functionality.

The issue affects all Blazor WASM PWA applications deployed to IIS servers, as the default web.config template in the SDK didn't include support for this file type that was re-included in .NET 10.

Solution

Added the missing MIME type mapping to the BlazorWasm.web.config template:

  • <remove fileExtension=".webmanifest" /> - Removes any existing IIS default mapping to prevent conflicts
  • <mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" /> - Maps .webmanifest files to the correct MIME type

The MIME type application/manifest+json was chosen to:

  • Match the existing definition in ContentTypeProvider.cs
  • Follow the W3C Web App Manifest specification standard
  • Ensure consistency across the SDK

Testing

  • All existing Blazor WebAssembly tests continue to pass
  • Verified the web.config template includes the new mapping in the correct location
  • Confirmed the change follows the same pattern as other file extension mappings

This fix ensures that Blazor WASM PWA applications work correctly on IIS without requiring developers to manually customize their web.config files.

Original prompt

This section details on the original issue you should resolve

<issue_title>Blazor WASM Standalone .webmanifest 404 error</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hello. I have a .net9 blazor wasm PWA app. I had some issues w/ caching and saw that there was a FIX in .net10 for re-including the webmanfiest. So I went ahead and added that. However, upon deployment I'm getting a 404 error when deploying to IIS.

Upon inspection, I can see that the default web.config is lacking a <remove fileExtension=".webmanifest" /><mimeMap fileExtension=".webmanifest" mimeType="application/json" />

Adding this manually fixes the console error. But, wouldn't this mean that new .net10 wasm pwa blazor apps will face this same issue? It doesn't seem like there's a easy fix for this for .net9 besides adding a custom web.config. However, I'm not sure what I would be missing from the "default" web.config template since it's autogenerated.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response</issue_description>

<agent_instructions>The fix is likely https://github.com/dotnet/sdk/blob/main/src/BlazorWasmSdk/Targets/BlazorWasm.web.config

Generate an explanation, make the changes if needed and do not add any test.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #51024

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Blazor WASM Standalone .webmanifest 404 error Add .webmanifest MIME type mapping to Blazor WASM web.config template Sep 26, 2025
Copilot AI requested a review from javiercn September 26, 2025 10:33
@javiercn javiercn marked this pull request as ready for review January 22, 2026 18:35
@javiercn javiercn requested a review from a team as a code owner January 22, 2026 18:35
Copilot AI review requested due to automatic review settings January 22, 2026 18:35
@javiercn javiercn force-pushed the copilot/fix-6072d044-02dc-4322-943a-a29a108f61aa branch from 01e5e63 to 4cf8e8b Compare January 22, 2026 18:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds MIME type configuration for .webmanifest files to the Blazor WebAssembly web.config template, fixing 404 errors that occur when PWA applications are deployed to IIS servers.

Changes:

  • Added .webmanifest file extension to the IIS MIME type mappings in the Blazor WASM web.config template
  • Used the MIME type application/manifest+json to match the SDK's ContentTypeProvider definition

@javiercn javiercn merged commit 701f795 into main Jan 26, 2026
27 checks passed
@javiercn javiercn deleted the copilot/fix-6072d044-02dc-4322-943a-a29a108f61aa branch January 26, 2026 11:31
@akoeplinger
Copy link
Member

@javiercn should we backport this to 10.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blazor WASM Standalone .webmanifest 404 error

5 participants