Skip to content

[main] Source code updates from nuget/nuget.client - #1937

Merged
ViktorHofer merged 11 commits into
mainfrom
darc-main-3f2a915f-70be-447f-a4c3-084008140bda
Aug 19, 2025
Merged

ViktorHofer merged 11 commits into
mainfrom
darc-main-3f2a915f-70be-447f-a4c3-084008140bda

Conversation

@dotnet-maestro

@dotnet-maestro dotnet-maestro Bot commented Aug 17, 2025 •

Copy link
Copy Markdown
Contributor

Note

This is a codeflow update. It may contain both source code changes from the source repo as well as dependency updates. Learn more here.

This pull request brings the following source code changes

From https://github.com/nuget/nuget.client

@dotnet-maestro

Copy link
Copy Markdown
Contributor Author

Important

There are conflicts with the main branch in this PR. Apart from conflicts in the source files, this means there are unresolved conflicts in the codeflow metadata file src/source-manifest.json.
When resolving these, please use the (incoming/ours) version from the PR branch. The correct content should be this:

{
  "barId": 279557,
  "path": "nuget-client",
  "remoteUri": "https://github.com/nuget/nuget.client",
  "commitSha": "aa6cfbc3e15f2054d4be1ffbcdd4e74777c2ba23"
}

In case of unclarities, consult the FAQ or tag @dotnet/product-construction for assistance.

@ViktorHofer
ViktorHofer enabled auto-merge (squash) August 18, 2025 06:16
@ViktorHofer

ViktorHofer commented Aug 18, 2025 •

Copy link
Copy Markdown
Member

@nkolev92 @mmitche different assembly versions based on the TFM is causing issue in consuming repos:

.dotnet\sdk\10.0.100-rc.1.25411.109\Microsoft.Common.CurrentVersion.targets(2437,5): error MSB3277: (NETCORE_ENGINEERING_TELEMETRY=Build) Found conflicts between different versions of "NuGet.Versioning" that could not be resolved.
There was a conflict between "NuGet.Versioning, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "NuGet.Versioning, Version=7.0.0.65534, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
    "NuGet.Versioning, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "NuGet.Versioning, Version=7.0.0.65534, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
    References which depend on "NuGet.Versioning, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [D:\a\_work\1\s\src\sdk\artifacts\.packages\nuget.versioning\7.0.0-preview.1.65534\lib\net9.0\NuGet.Versioning.dll].
        D:\a\_work\1\s\src\sdk\artifacts\.packages\nuget.versioning\7.0.0-preview.1.65534\lib\net9.0\NuGet.Versioning.dll
          Project file item includes which caused reference "D:\a\_work\1\s\src\sdk\artifacts\.packages\nuget.versioning\7.0.0-preview.1.65534\lib\net9.0\NuGet.Versioning.dll".
            D:\a\_work\1\s\src\sdk\artifacts\.packages\nuget.versioning\7.0.0-preview.1.65534\lib\net9.0\NuGet.Versioning.dll
    References which depend on or have been unified to "NuGet.Versioning, Version=7.0.0.65534, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
        D:\a\_work\1\s\src\sdk\artifacts\bin\Microsoft.DotNet.PackageValidation\Release\net8.0\Microsoft.DotNet.PackageValidation.dll
          Project file item includes which caused reference "D:\a\_work\1\s\src\sdk\artifacts\bin\Microsoft.DotNet.PackageValidation\Release\net8.0\Microsoft.DotNet.PackageValidation.dll".
            D:\a\_work\1\s\src\sdk\artifacts\bin\Microsoft.DotNet.PackageValidation\Release\net8.0\Microsoft.DotNet.PackageValidation.dll
            D:\a\_work\1\s\src\sdk\artifacts\bin\Microsoft.DotNet.ApiCompat.Task\Release\net8.0\Microsoft.DotNet.ApiCompat.Task.dll

This is due to sdk's APICompat / PackageValidation targeting net8.0 (the minimum in-support version of .NETCoreApp) while nuget now only supports net9.0 and net472. Due to that, the net472 assembly gets chosen. We never want that to happen.
@nkolev92 @zivkan why does nuget target net9.0 instead of net8.0 as the min version for .NETCoreApp?

@nkolev92

Copy link
Copy Markdown
Contributor

I moved us from net8 to net9 to primarily take advantage of the X509CertificateLoader changes.
We were using different code in our tests vs our product, and I thought it was adding unnecessary risk.

We had been far behind other components in our target tfm, because we were tethered to NS2.0 due to the ilmerge issue, so I saw this as an opportunity to catch-up and simplify our builds.

Why does package validation need to target .nET 8? Because it ships OOB?

I'd love to remain at .NET 9, but it very likely affects your distributions strategy, so I'll work on a branch reverting the changes, because of the schedule being super close.

I think our assembly version changes are probably here to stay because it'll make it really hard for us to get .NET SDK from within our own repo.

@ViktorHofer

Copy link
Copy Markdown
Member

Why does package validation need to target .nET 8? Because it ships OOB?

Correct. Basically, you have customers who use in support versions of .NET and you don't want to lock them out. PackageValidation lives in SDK so it shows up here but this would impact any customer in the ecosystem who uses latest NuGet. PackageValidation must be on latest because it also ships in the .NET SDK.

I'd love to remain at .NET 9, but it very likely affects your distributions strategy, so I'll work on a branch reverting the changes, because of the schedule being super close.

I strongly recommend to go back to .NET 8. That's the TFM that all our ecosystem packages target (like System.Text.Json) cause that's the minimum in-support version. Going higher than that in non app-model packages (which are different, like aspnetcore or msbuild) unnecessarily locks customers out.

I think our assembly version changes are probably here to stay because it'll make it really hard for us to get .NET SDK from within our own repo.

Yes, those are fine if we fix the TFM issue.

@nkolev92

Copy link
Copy Markdown
Contributor

What are the packages you ship?
Is it https://www.nuget.org/packages/Microsoft.DotNet.ApiCompat.Tool?

The download counts seem to pretty low, so OOB usage of API validation doesn't seem to be super comon.
It's been in the product for 3-4 years correct?

I strongly recommend to go back to .NET 8. That's the TFM that all our ecosystem packages target (like System.Text.Json) cause that's the minimum in-support version. Going higher than that in non app-model packages (which are different, like aspnetcore or msbuild) unnecessarily locks customers out.

Our policies are primarily tied around NuGet as tooling. NuGet the tool, ships in 4 different products and we prioritize those over the packages.
Customers can always stay on an older supported version of NuGet. We will still patch those for security fixes.

Our packages recently migrated for net5 to net8 and we didn't really get any feedback. That was a move to the current .NET version at that point I think.

@ViktorHofer
ViktorHofer disabled auto-merge August 18, 2025 15:50
@ViktorHofer

ViktorHofer commented Aug 18, 2025 •

Copy link
Copy Markdown
Member

The download counts seem to pretty low, so OOB usage of API validation doesn't seem to be super comon.
It's been in the product for 3-4 years correct?

It's not common but it's an option for outside of msbuild context environments.

Our policies are primarily tied around NuGet as tooling. NuGet the tool, ships in 4 different products and we prioritize those over the packages.

Given that NuGet.* packages are widely used in the .NET ecosystem (based on the download count from nuget.org), I'm surprised to hear that. While I understand that your tooling scenarios are the driver for most changes, package consumers are also a customer base.

But to draw this back to the initial comment: The TFM update currently blocks all insertions into the .NET SDK: RC 1, RC2 and main (this PR). Thanks for taking a look.

@nkolev92

Copy link
Copy Markdown
Contributor

Apparently GH allows PRs to close other PRs in a completely different org and repo haha.

@ViktorHofer

Copy link
Copy Markdown
Member

More issues due to the netstandard2.0 TFM removal but this time in runtime.

@ViktorHofer

ViktorHofer commented Aug 19, 2025 •

Copy link
Copy Markdown
Member

Hmm I'm confused. I only see two TFMs now:

image

That package was produced on Thursday so maybe something was wrong back then.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants