OnoSendai
OnoSendai

Reputation: 3970

Show only LTS updates for NuGet packages in Visual Studio

Preamble

My org is low-risk so we're planning to stick to LTS releases (.NET Core 3.1 at the time of this post.) The Nuget Package Manager Updates list, however, currently offers non-LTS updates (namely to .NET 5.0.)

Question

Is there a way to configure Visual Studio in a way to show LTS updates only? Alternatively, is there any other way I can achieve the same desired result?


(This question is actually almost a copy of Lion's original, but I'm hoping that improvements on api.nuget.org or in the way Visual Studio handles API results may result in a viable answer.)

Upvotes: 0

Views: 619

Answers (1)

Mr Qian
Mr Qian

Reputation: 23818

Your question is a real good question. And many community members want this feature on PackageReference for net core projects.

In fact, what you want is not supported on PackageReference so far. And net framework projects with packages.config nuget management format can realize it. See this official document.

Under packages.config, you can use allowedVersions node for nuget packages on packages.config file, such as [3.1.0, 5.0.0). It means 3.1.0 <= current version < 5.0.0. You can only update the nuget package under that range on the Nuget Package Manager UI.

It is quite useful feature but Microsoft has not added this feature for the new-sdk project with PackageReferece. Therefore, many community members has raised this issue on github which is still in processing.

And the Team has planned to fix the problem on December 20. So I suggest you could follow that github link and add any comments to describe your issue to raise more attention from Microsoft' team. All of them will help solve the problem as soon as possible.

Upvotes: 1

Related Questions