Skip to content

Commit

Permalink
React to NuGet package pruning warnings (#15008)
Browse files Browse the repository at this point in the history
Contributes to dotnet/sdk#46642

NuGet added a new feature that automatically prunes package and project references that are provided by the shared framework that is targeted.

React to two warnings that got flagged when building the product source-only.
  • Loading branch information
ViktorHofer authored Feb 12, 2025
1 parent 6f1833e commit 9a14840
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@
<ItemGroup>
<!-- net48 includes tuple, we need to reference it in previous versions but only on .net framework. -->
<PackageReference Include="System.ValueTuple" Version="4.5.0"
Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net48')) != true
and $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net4'))" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net48')) != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 9a14840

Please sign in to comment.