Skip to content

Incompatible change to NuGet package resolution #11823

@Zastai

Description

@Zastai

NuGet Product Used

dotnet.exe, MSBuild.exe

Product Version

6.0.300 / 17.2

Worked before?

6.0.20x / 17.1

Impact

It's more difficult to complete my work

Repro Steps & Context

We have a company nuget server (using Nexus), which hosts not only our own packages, but also any versions of third-party packages that have been allowlisted (so no nuget.org access).

We only target version 4.7.2 (or very occasionally 4.8) of the .NET framework, and our builds are set up to reference microsoft.netframework.referenceassemblies 1.0.0 to ensure that works everywhere.

Previous NuGet resolution only pulled in microsoft.netframework.referenceassemblies itself, plus microsoft.netframework.referenceassemblies.net472 and/or microsoft.netframework.referenceassemblies.net48, matching what we target.

However, the same projects now fail to restore with the 6.0.300 SDK that comes with VS2022 17.2:

error NU1101: Unable to find package Microsoft.NETFramework.ReferenceAssemblies.net461. No packages exist with this id in source(s): <company feed>

(And the project in question does NOT target net461.)
This feels like a pretty significant regression.

To Reproduce

  • set up a feed containing only microsoft.netframework.referenceassemblies and its net472 and net48 sub-packages
  • create a project targeting net472 or net48 (plus optionally something else, like netstandard2.1)
  • add a package reference to microsoft.netframework.referenceassemblies
  • run dotnet restore

Verbose Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions