Skip to content

.NET features tests fail against an SDK checkout since #943: System.Text.Json 9.0.0.0 not found #960

Backlog

Description

@johanngan

Summary

Since #943, the .NET features tests fail when they're run against an SDK checkout instead of a NuGet release. sdk-dotnet's CI runs them this way (the features-tests job, which calls dotnet.yaml@main with version-is-repo-ref: true), so that job now fails on every sdk-dotnet branch, including main. The failure is at runtime:

Unhandled exception: System.TypeInitializationException: The type initializer for 'Temporalio.Converters.DataConverter' threw an exception.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Example: https://github.com/temporalio/sdk-dotnet/actions/runs/45490114975 (sdk-dotnet main at 216a1ff). The features repo's own CI doesn't catch it, because it tests against the 1.22.0 NuGet packages.

Cause

#943 added a second ProjectReference to dotnet.csproj for the TemporalioProjectReference case:

<ProjectReference Include="$(TemporalioProjectReference)" />
<ProjectReference Include="$([System.IO.Path]::GetDirectoryName('$(TemporalioProjectReference)'))/../Temporalio.Extensions.OpenTelemetry/Temporalio.Extensions.OpenTelemetry.csproj" />

The two references build Temporalio for different target frameworks:

  • The harness targets net8.0, so its direct reference builds Temporalio for netcoreapp3.1. That build uses the framework's own System.Text.Json (8.0 on .NET 8).
  • Temporalio.Extensions.OpenTelemetry only targets netstandard2.0 and net462, so through it, Temporalio is also built for netstandard2.0. That build references the System.Text.Json 9.x NuGet package.

Both builds of Temporalio.dll are copied to the same output directory, and the netstandard2.0 one ends up there. MSBuild then resolves the System.Text.Json conflict in favor of the framework's 8.0 and doesn't deploy 9.0, so loading Temporalio fails at runtime. The build log shows this as MSB3277 warnings, which name the program's build/Temporalio.dll as the reference that depends on System.Text.Json 9.0.0.0:

There was a conflict between "System.Text.Json, Version=8.0.0.0, ..." and "System.Text.Json, Version=9.0.0.0, ...".
"System.Text.Json, Version=8.0.0.0, ..." was chosen because it was primary and "System.Text.Json, Version=9.0.0.0, ..." was not.
References which depend on or have been unified to "System.Text.Json, Version=9.0.0.0, ..." [].
    .../features/program-3477878515/build/Temporalio.dll

NuGet consumers aren't affected, since NuGet picks one set of assets per package.

Timeline

sdk-dotnet run features commit features-tests
44841577178 (2026-11-21) aeb7812e passed
45334133349 (2026-11-24, Dependabot) f47d8813 (#943) failed
45490114975 (2026-11-24, main) f47d8813 failed

Every sdk-dotnet run since #943 merged has failed the same way.

Possible fixes

These haven't been tried:

  • In dotnet.csproj, when TemporalioProjectReference is set, also reference the System.Text.Json 9.x package, so the netstandard2.0 build of Temporalio can load.
  • In sdk-dotnet, give Temporalio.Extensions.OpenTelemetry a netcoreapp3.1 target, so that both references use the same build of Temporalio.

Activity

  1. added
    bug
    on Nov 25, 2026
  2. johanngan commented on Nov 25, 2026

    @johanngan
    Author

    Apologies for Claude slop, haven't dug into this too deeply myself yet, but figured I'd save someone else a bit of effort/tokens.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions