Skip to content

Commit c6ae83f

Browse files
authored
Make system text json version compatible with powershell (#3569)
* Update compiled system text json version for netstandard2.0 and net472 to 6.0.11 for powershell compatibility and add overrides.targets file.
1 parent 6215931 commit c6ae83f

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

sdk/src/Core/AWSSDK.Core.NetFramework.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
<ItemGroup>
7272
<PackageReference Include="System.Buffers" Version="4.5.1" />
7373
<PackageReference Include="System.Memory" Version="4.5.5" />
74-
<PackageReference Include="System.Text.Json" Version="8.0.5" />
74+
<!-- Powershell (pwsh) will have a preloaded version of System.Text.Json that is older than
75+
the version we will ship in core nuget packages and dlls, so we compile with an older version of STJ
76+
but ship nuget packages and dlls with newer versions of STJ. If we don't do this then sdk assemblies will fail
77+
to load in powershell due to unsupported versions -->
78+
<PackageReference Include="System.Text.Json" Version="6.0.11" />
7579
</ItemGroup>
80+
<Import Project="overrides.targets"/>
7681
</Project>

sdk/src/Core/AWSSDK.Core.NetStandard.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
8484
<PackageReference Include="System.Buffers" Version="4.5.1" />
8585
<PackageReference Include="System.Memory" Version="4.5.5" />
86-
<PackageReference Include="System.Text.Json" Version="8.0.5" />
86+
<!-- Powershell 7+ already has a preloaded version of system text json which is older than the version
87+
we ship in nuget packages and dlls. To ensure SDK assemblies can be loaded in powershell, we must compile with
88+
an older version of System.Text.Json. -->
89+
<PackageReference Include="System.Text.Json" Version="6.0.11" />
8790
</ItemGroup>
91+
<Import Project="overrides.targets"/>
8892
</Project>

sdk/src/Core/overrides.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<ItemGroup>
3+
<!--The package reference element is dynamically uncommented during the build system ZIP file creation-->
4+
<!--<PackageReference Update="System.Text.Json" Version="8.0.5" />-->
5+
</ItemGroup>
6+
</Project>

0 commit comments

Comments
 (0)