Skip to content

AmbiguousMatchException on System.Text.Json deserialization with FSharp.Core version 9.0.300 #18596

Description

@WithinUA

When I deserialize FSharp class I get this exception

Repro steps

just download and run this project

MultipleCompilationMappingAttributesRepro.zip

Expected behavior

No exception

Actual behavior

System.Reflection.AmbiguousMatchException: Multiple custom attributes of the same type 'Microsoft.FSharp.Core.CompilationMappingAttribute' found.

Known workarounds

Downgrade to 9.0.202 or lower

Related information

  • .NET 8, 9

Activity

  1. added theissue type on May 22, 2025
  2. added this to the Backlog milestone on May 22, 2025
  3. T-Gro commented on May 23, 2025

    @T-Gro
    Member

    This was addressed with dotnet/runtime#114961 , duplicate of dotnet/runtime#114824

  4. cmeeren commented on Jun 13, 2025

    @cmeeren
    Contributor

    As far as I can tell, a fix was published in .NET 9.0.6 (SDK 9.0.301). At least that was the milestone used here. But when running with FSharp.Core 9.0.300 on .NET 9.0.6, I still get this error. It therefore seems I have no recourse but to downgrade FSharp.Core to 9.0.202.

    When can I safely upgrade to FSharp.Core 9.0.300?

  5. T-Gro commented on Jun 16, 2025

    @T-Gro
    Member

    @cmeeren : This did not meet the dotnet/runtime's bar for a servicing, and the change only applies to .NET 10, including preview versions of .NET 10.
    The combination of .NET 9 runtime and 9.0.300 FsharpCore will still have this error unfortunately.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions