0

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.)

OnoSendai
  • 3,960
  • 2
  • 22
  • 46

1 Answers1

1

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.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41
  • Thank you, I wasn't aware of the existence of that GitHub issue and I really appreciate you bringing that to my attention: I'll add my two cents later. Personally I think this problem could be better handled by the addition of meta-information about the LTS status - something like `allowedTags="['LTS','long-term-support']"` thus bypassing the need to know the version range, but that's a different can of worms. – OnoSendai Dec 16 '20 at 14:36
  • Thanks for your feedback. VS is not yet so flexible to keep nuget's version consistent with targetframeowrk LTS. So for now, we can only wait for Microsoft to add `allowversion` to `PackageReference`. And since what your suggested is another new feature, if you still want yours, I suggest you could [suggest your idea on the DC Forum](https://developercommunity.visualstudio.com/content/idea/post.html?space=8) to get their attention. – Mr Qian Dec 17 '20 at 09:26
  • @OnoSendaim, since you cannot do anything more here on so and have to wait to the team's feedback, I suggest you could mark this answer to give other community members a right direction about this issue. And it is kind of you to do that. – Mr Qian Jan 13 '21 at 02:49