Skip to content

Commit b0bc0d1

Browse files
authored
Enable transitive pinning for central package management (microsoft#6225)
## πŸ“– Description <!-- Describe what this PR changes, why, and any limitations. --> This PR enables transitive pinning for central NuGet package management. This makes the version declared in `Directory.Packages.props` apply to transitive dependencies, without having to add them as direct dependencies of a project. This solves a CG alert about `System.Security.Cryptography.Xml` in `AppInstallerCLIE2ETests.csproj`. I'm also removing references that I believe were there only to pin their version with CPM ## πŸ”— References <!-- Link related issues, PRs, or docs. Use "Resolves #1234" to auto-close. --> https://learn.microsoft.com/nuget/consume-packages/central-package-management#transitive-pinning ## πŸ” Validation <!-- How did you test? List manual steps or note automated test coverage. --> Fully untested because a VS update left me unable to build the project :-) ## βœ… Checklist <!-- Place an "x" between the brackets to check an item. e.g: [x] --> - [ ] Signed the [Contributor License Agreement](https://cla.opensource.microsoft.com) - [ ] Linked to an issue - [ ] Updated [Release Notes](../doc/ReleaseNotes.md) (if applicable) - [ ] Updated documentation (if applicable) - [ ] Updated [Copilot instructions](.github/copilot-instructions.md) (if build, architecture, or conventions changed) ## πŸ“‹ Issue Type <!-- Select the type that best describes this PR --> - [ ] Bug fix - [ ] Feature - [ ] Task ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/6225)
1 parent 933c96b commit b0bc0d1

6 files changed

Lines changed: 2 additions & 14 deletions

File tree

β€Žsrc/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csprojβ€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
<PrivateAssets>all</PrivateAssets>
3434
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3535
</PackageReference>
36-
<PackageReference Include="System.Data.SqlClient" />
37-
<PackageReference Include="System.Text.RegularExpressions" />
3836
</ItemGroup>
3937

4038
<!-- CsWinRT properties -->

β€Žsrc/Directory.Packages.propsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
45
<!--
56
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
67
-->
@@ -32,7 +33,7 @@
3233
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
3334
<PackageVersion Include="System.Security.Cryptography.Xml" Version="8.0.3" />
3435
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0" />
35-
<PackageVersion Include="System.Text.Json" Version="8.0.6" />
36+
<PackageVersion Include="System.Text.Json" Version="9.0.6" />
3637
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
3738
<PackageVersion Include="xunit" Version="2.4.2" />
3839
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />

β€Žsrc/Microsoft.Management.Configuration.Processor/Microsoft.Management.Configuration.Processor.csprojβ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@
4343
<PackageReference Include="Microsoft.PowerShell.SDK" GeneratePathProperty="true">
4444
<ExcludeAssets>contentFiles</ExcludeAssets>
4545
</PackageReference>
46-
<PackageReference Include="Newtonsoft.Json" />
4746
<PackageReference Include="StyleCop.Analyzers">
4847
<PrivateAssets>all</PrivateAssets>
4948
</PackageReference>
50-
<PackageReference Include="System.Data.SqlClient" />
51-
<PackageReference Include="System.Security.Cryptography.Xml" />
5249
</ItemGroup>
5350

5451
<ItemGroup Condition="'$(WinGetCsWinRTEmbedded)'!='true'">

β€Žsrc/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csprojβ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020

2121
<ItemGroup>
2222
<PackageReference Include="Microsoft.NET.Test.Sdk" />
23-
<PackageReference Include="Newtonsoft.Json" />
24-
<PackageReference Include="System.Net.Http" />
2523
<PackageReference Include="System.Private.Uri" />
26-
<PackageReference Include="System.Text.RegularExpressions" />
2724
<PackageReference Include="xunit" />
2825
<PackageReference Include="xunit.runner.visualstudio">
2926
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

β€Žsrc/WinGetSourceCreator/WinGetSourceCreator.csprojβ€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.Msix.Utils" />
12-
<PackageReference Include="System.Net.Http" />
13-
<PackageReference Include="System.Text.RegularExpressions" />
1412
</ItemGroup>
1513

1614
<ItemGroup>

β€Žsrc/WinGetUtilInterop.UnitTests/WinGetUtilInterop.UnitTests.csprojβ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Newtonsoft.Json" />
109
<PackageReference Include="Microsoft.ApplicationInsights" />
1110
<PackageReference Include="Microsoft.AspNet.WebApi.Client" />
1211
<PackageReference Include="Microsoft.Msix.Utils" />
1312
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1413
<PackageReference Include="Moq" />
15-
<PackageReference Include="System.Net.Http" />
16-
<PackageReference Include="System.Text.RegularExpressions" />
1714
<PackageReference Include="xunit" />
1815
<PackageReference Include="xunit.runner.visualstudio" />
1916
<PackageReference Include="coverlet.collector" />

0 commit comments

Comments
Β (0)