Skip to content

Commit 37ca1a4

Browse files
Do not reference System.Text.Json for .NET 8+ (#4019)
#3933 mistakenly removed the target framework condition for STJ. Referencing the STJ package on .NET 8+ causes the STJ source generator to run twice, resulting in build errors. See dotnet/wpf#8943. <!-- Please be sure to read the [Contribute](https://github.com/reactiveui/reactiveui#contribute) section of the README --> **What kind of change does this PR introduce?** <!-- Bug fix, feature, docs update, ... --> Bug fix **What is the current behavior?** <!-- You can also link to an open issue here. --> Build errors for projects referencing ReactiveUI and using STJ source generation at the same time. **What is the new behavior?** <!-- If this is a feature change --> No build errors. **What might this PR break?** **Please check if the PR fulfills these requirements** - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) **Other information**:
1 parent 1a5e915 commit 37ca1a4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ReactiveUI/ReactiveUI.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@
5858
<Compile Include="Platforms\net\**\*.cs" />
5959
<PackageReference Include="System.ComponentModel.Annotations" />
6060
</ItemGroup>
61+
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('net4'))">
62+
<PackageReference Include="System.Text.Json" />
63+
</ItemGroup>
6164
<ItemGroup>
6265
<PackageReference Include="Splat" />
6366
<PackageReference Include="DynamicData" />
64-
<PackageReference Include="System.Text.Json" />
6567
</ItemGroup>
6668
<ItemGroup>
6769
<None Update="VariadicTemplates.tt" Generator="TextTemplatingFileGenerator" LastGenOutput="VariadicTemplates.cs" />

0 commit comments

Comments
 (0)