Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How can I exclude .NET 9 updates in Visual Studio Package Manager

$
0
0

The Package Manager in Visual Studio 2022 tries to force me to update System/Microsoft packages to .NET9 versions. But I don't want to use .NET9, instead, stay on the latest .NET8 patch versions.

Is there any way to limit versions in Package Manager to major version 8?

For example:

Microsoft.EntityFrameworkCore 8.0.8=> Microsoft.EntityFrameworkCore 8.0.11But not to: Microsoft.EntityFrameworkCore 9.0.0

So, the annoying thing is, that the Updates view always shows me tons of updates, which I don't want, and I have to look up every individual package to check if a patch version within the .net8.0 framework is available.

Visual Studio package manager view, showing all NET 9 updates

I get the same issue when checking for updates in Powershell via dotnet command:

dotnet list "Utility.sln" package --source "nuget.org" --framework "net8.0" --outdated

The --framework "net8.0" option doesn't limit new versions to .NET 8 packages.

I am using Central Package Management (CPM), with Directory.Packages.props file for versions.

Temporary workaround

With the dotnet command, the options --highest-minor and --highest-patch exist, but for checking only.

dotnet list "Utility.sln" package --source "nuget.org" --outdated --highest-patch

An alternative for updates is the Package Manager console in Visual Studio itself, or another, similar use of NuGet commands:

Update-Package "Microsoft.EntityFrameworkCore" -ToHighestPatch

or all packages (filter by source, e.g. nuget.org, is also possible).

Update-Package -ToHighestPatch 

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>