Repository navigation
Description
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 buildsTemporaliofornetcoreapp3.1. That build uses the framework's ownSystem.Text.Json(8.0 on .NET 8). Temporalio.Extensions.OpenTelemetryonly targetsnetstandard2.0andnet462, so through it,Temporaliois also built fornetstandard2.0. That build references theSystem.Text.Json9.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, whenTemporalioProjectReferenceis set, also reference theSystem.Text.Json9.x package, so thenetstandard2.0build ofTemporaliocan load. - In sdk-dotnet, give
Temporalio.Extensions.OpenTelemetryanetcoreapp3.1target, so that both references use the same build ofTemporalio.
Activity
johanngan commentedon Nov 25, 2026
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.