Skip to content

using JsonPatch packages not working in blazor-wasm #64330

Closed

Description

@tallichet

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have a client API project which uses Microsoft.AspNetCore.JsonPatch nuget to be able to call PATCH requests with JsonPatchDocument<>.

When upgrading to version 10 either with Microsoft.AspNetCore.JsonPatch or Microsoft.AspNetCore.JsonPatch.SystemTextJson, my blazor-wasm project is not compiling anymore. It seems the JsonPatch is having a link to aspnet SDK.

The build error:

>C:\Program Files\dotnet\sdk\10.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(544,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'.

Expected Behavior

IMO, this package should work in blazor wasm projects

Steps To Reproduce

Create a Blazor Web App with in Auto mode.
Add reference to Microsoft.AspNetCore.JsonPatch 10.0.0 in the App.Client project
Build

Exceptions (if any)

No response

.NET Version

10.0

Anything else?

No response

Activity

  1. added
    area-blazor
    on Nov 12, 2025
  2. added
    Needs: Repro
    on Nov 13, 2025
  3. added
    Needs: Author Feedback
    on Nov 13, 2025
  4. acoudene commented on Nov 19, 2025

    @acoudene

    Hello,

    I have the same problem.

    Here a minimal repro project as a simple Blazor where client part just referencing JsonPatch assembly in .Net 10.
    BlazorJsonPatch10CompilationError

    In summary, if I use in Client WebAssembly:
    <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.0" />

    Then I will get this error:
    1>C:\Program Files\dotnet\sdk\10.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(544,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'.

    But no error if I put this previous one:
    <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="9.0.11" />

  5. added
    area-networking
    and removed
    Needs: Author Feedback
    Needs: Repro
    area-blazor
    on Nov 20, 2025
  6. danroth27 commented on Nov 21, 2025

    @danroth27
    Member

    @joperezr @mikekistler Did we accidentally introduce an ASP.NET Core framework reference to our JSON Patch support in .NET 10?

  7. acoudene commented on Nov 21, 2025

    @acoudene

    @joperezr @mikekistler Did we accidentally introduce an ASP.NET Core framework reference to our JSON Patch support in .NET 10?

    If this dependency in csproj: <Reference Include="Microsoft.AspNetCore.Http.Abstractions" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" /> with this property inside Microsoft.AspNetCore.Http.Abstractions : <IsAspNetCoreApp>true</IsAspNetCoreApp> and the fact that <IsPackable>false</IsPackable> could be the issue?

  8. mikekistler commented on Nov 21, 2025

    @mikekistler

    Did we accidentally introduce an ASP.NET Core framework reference to our JSON Patch support in .NET 10?

    Honestly it never crossed my mind that someone would use this outside the context of an ASP.NET Core app. Was that a requirement?

  9. danroth27 commented on Nov 21, 2025

    @danroth27
    Member

    Honestly it never crossed my mind that someone would use this outside the context of an ASP.NET Core app. Was that a requirement?

    Yeah, it's not uncommon to use JsonPatchDocument to create PATCH requests that you then send with HttpClient, although I don't know that we've ever officially documented that as a scenario. This does appear to be related to the Microsoft.AspNetCore.Http.Abstractions dependency.

  10. 11 remaining items

  11. martincostello commented on Nov 25, 2025

    @martincostello
    Member

    I don't understand why we made any changes to the old Newtonsoft-based package

    It made sense when I picked it up that the implementations should be symmetrical, but the root cause could be attributed to Copilot as it did that in the original #62057 PR that I picked up the work from.

    I didn't know the packages needed to support Blazor-WASM, the test coverage didn't highlight it broke the scenario, and human reviewers didn't spot it either.

  12. javiercn commented on Nov 25, 2025

    @javiercn
    Member

    The only thing that I can think for us to fix this at this point will be to produce a separate package for wasm for the S.T.J implementation (I imagine people can still use the old newtonsoft.json package in wasm)

    We can't take back adding/removing interfaces in patches (don't ask me how I know)

  13. tallichet commented on Nov 26, 2025

    @tallichet
    Author

    As per my understanding, the lib should be used for both server and client side. Since then, it should run in WASM and MAUI, as they are common client technologies.

  14. HunterAhlquist commented on Jan 5, 2026

    @HunterAhlquist

    Having the same problem since I am using JsonPatch in the frontend. Downgrading to the .NET 9 version is my workaround

  15. mdbreger commented on Feb 24, 2026

    @mdbreger

    Can we please have an update on this blocking topic ?

  16. self-assigned this
    on Feb 27, 2026
  17. HunterAhlquist commented on Mar 5, 2026

    @HunterAhlquist

    The proposed fix did not fix the issue on this thread. I still get:
    There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'.
    Please re-open this issue.

  18. martincostello commented on Mar 5, 2026

    @martincostello
    Member

    The issue is closed as the relevant code changes have been made, but it hasn't been released.

  19. HunterAhlquist commented on Mar 5, 2026

    @HunterAhlquist

    The issue is closed as the relevant code changes have been made, but it hasn't been released.

    My bad, I really should work on my reading comprehension. 🤦‍♂️

  20. brumlemann commented on Mar 17, 2026

    @brumlemann

    This issue was closed as fixed by #65674, but the fix is incomplete. The 10.0.5 package still declares in its nuspec despite the IEndpointParameterMetadataProvider code being reverted. This means the package still can't be used in Blazor WASM or in apps
    running on dotnet/runtime images without the ASP.NET Core shared framework.

    See my comment on #65674 for details and evidence: (link to PR comment)

  21. davidmilligan commented on May 14, 2026

    @davidmilligan

    The PR linked to this issue only fixes the issue for the newtonsoft based JsonPatch (Microsoft.AspNetCore.JsonPatch) being used from blazor wasm or other environments w/o asp.net core stuff. The Microsoft.AspNetCore.JsonPatch.SystemTextJson is still not usable from blazor wasm. I would like to have a SJT based, json patch library available in blazor wasm:

    • I don't want my blazor wasm app to have a dependency on newtonsoft
    • I need to generate and perform patch operations on the client side (json patch is great for merging incoming changes or implementing an "undo" feature)
    • I need a single library to work for both wasm and asp.net server app (as it will be used in a project shared by both)

    Will this issue be re-opened or shall I create a new issue?

  22. martincostello commented on May 14, 2026

    @martincostello
    Member

    From #64330 (comment):

    We can't take back adding/removing interfaces in patches (don't ask me how I know)

  23. davidmilligan commented on May 14, 2026

    @davidmilligan

    yeah, ok I saw that, doesn't change what I want, just means it needs to be a breaking change in 11 instead right? I still want it captured somewhere that is what I want. Sounds like I need to make a new issue?

  24. danroth27 commented on May 19, 2026

    @danroth27
    Member

    yeah, ok I saw that, doesn't change what I want, just means it needs to be a breaking change in 11 instead right? I still want it captured somewhere that is what I want. Sounds like I need to make a new issue?

    @davidmilligan See #65986

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

Metadata

Metadata

Labels

area-networking

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions