Skip to content

Package cleanup - #677

Open
ZacMarcus wants to merge 4 commits into
XeroAPI:masterfrom
ZacMarcus:package-cleanup
Open

ZacMarcus wants to merge 4 commits into
XeroAPI:masterfrom
ZacMarcus:package-cleanup

Conversation

@ZacMarcus

Copy link
Copy Markdown

Depends on #675. This branch is built on top of it to avoid conflicts in the same .csproj lines, so the first two commits shown here belong to #675. Only the last two commits are new; please review/merge #675 first.

Summary

A tidy-up of package references across the three projects. All version bumps stay within the current major version.

Removed

Project Package Why
Xero.NetStandard.OAuth2 CompareNETObjects 4.83.0 Not used anywhere in the code
Xero.NetStandard.OAuth2 JsonSubTypes 2.0.1 Not used anywhere in the code
Test Microsoft.Extensions.Configuration (Version="*") Floating version that resolved to 10.0.14 while the other Microsoft.Extensions.* packages are on 8.x. It's already brought in by Configuration.Json, so it now resolves 8.0.0.
Test Microsoft.Extensions.Configuration.FileExtensions 8.0.1 Already brought in by Configuration.Json (still resolves 8.0.1)

Added

Project Package Why
Xero.NetStandard.OAuth2 Microsoft.CSharp 4.7.0 ClientUtils.ConvertType uses dynamic, which needs Microsoft.CSharp on .NET Standard 2.0. It was previously only brought in by CompareNETObjects; without it the build fails with CS0656.

Updated

Project Package Version
OAuth2Client Newtonsoft.Json 13.0.3 → 13.0.4
OAuth2Client System.Net.Http.Json 8.0.0 → 8.0.1
Test Microsoft.NET.Test.Sdk 17.11.1 → 17.14.1
Test xunit 2.9.2 → 2.9.3

Things to be aware of

  • Xero.NetStandard.OAuth2.csproj appears to be generated. It's only changed by the "Releasing x.y.z" commits, so the next release will might bring CompareNETObjects and JsonSubTypes back and drop Microsoft.CSharp. For the removal to stick, the generator's .csproj template needs the same change.
  • Consumers lose two indirect packages. Apps that install Xero.NetStandard.OAuth2 currently get CompareNETObjects and JsonSubTypes without asking for them. Any app using either without its own reference would need to add one when upgrading. This is unlikely, but it's a visible change.

Not included

These are larger changes which I will do in separate PRs:

  • IdentityModel 7.0.0 is deprecated in favour of Duende.IdentityModel. Switching changes namespaces in OAuth2Client.
  • xunit v2 is deprecated in favour of xunit.v3, which would also mean moving xunit.runner.visualstudio to a newer major version.
  • Microsoft.Extensions.* 8.x → 10.x and Microsoft.NET.Test.Sdk 17 → 18 in the test project.

Testing

  • dotnet restore passes with NuGetAuditMode=all (from Fix vulnerable transitive System.Text.Json dependency #675), and there are no vulnerable packages.
  • dotnet build succeeds for the full solution. The only warnings are the existing CS0472 ones in the generated code.
  • dotnet test --list-tests discovers the same 2057 tests as before. I haven't run the suite locally since it needs the Prism mock server; CI will cover it.

ZacMarcus and others added 4 commits November 5, 2026 20:46
Bump System.IdentityModel.Tokens.Jwt 8.1.0 -> 8.23.0 in OAuth2Client, which
lifts the resolved System.Text.Json from 8.0.4 to 8.0.5 (GHSA-8g4q-xg66-9fp4).

Bump Microsoft.Extensions.Configuration.Json 8.0.0 -> 8.0.1 in the test
project, which drops its System.Text.Json 8.0.0 package dependency on net8.0
(GHSA-hh2w-p6rv-4g7w, GHSA-8g4q-xg66-9fp4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set NuGetAuditMode to all so restore checks the full dependency graph, not
just direct references. Combined with the existing WarningsAsErrors for
NU1901-NU1905, a vulnerable transitive package now fails restore instead of
going unnoticed, as System.Text.Json did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test project:
- Remove Microsoft.Extensions.Configuration. It used a floating "*" version
  that resolved to 10.x while the other Microsoft.Extensions packages are on
  8.x, and it is already brought in by Configuration.Json (now 8.0.0).
- Remove Microsoft.Extensions.Configuration.FileExtensions, also brought in by
  Configuration.Json (still resolves 8.0.1).
- Bump Microsoft.NET.Test.Sdk 17.11.1 -> 17.14.1 and xunit 2.9.2 -> 2.9.3.

OAuth2Client:
- Bump Newtonsoft.Json 13.0.3 -> 13.0.4 and System.Net.Http.Json
  8.0.0 -> 8.0.1.

All bumps stay within the current major version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neither package is referenced anywhere in the code. CompareNETObjects was
however the only thing bringing in Microsoft.CSharp, which ClientUtils needs
for its use of dynamic, so reference Microsoft.CSharp 4.7.0 directly instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant