Locking NuGet updates to major .NET version
Hi there,
Is there a way to lock NuGet package updates to a particular major version of .NET? Where I work we can only update our .NET version to LTS, so every other year we have to be very careful about not using “Upgrade Packages in Solution”
This occured for .NET 7 and now again for .NET 9
Please sign in to leave a comment.
Hello Lumai,
Thank you for contacting Rider support.
If I properly understand the problem and what you need, you might want to consider using the Central Package Management.
Using per-directory/per-solution/per-project .props files allows specifying exact versions of packages to be used.
If that doesn't help or you have any other questions or difficulties, please let me know.
Have a nice day!
Hi Dmitry,
Thanks for the reply! Central package management is great, but it unfortunately doesn’t solve the issue I’m having. It’s more around ensuring versions of nuget packages don’t appear as an option to upgrade when they rely on other packages that would unintentionally raise the .NET version of packages.
Hello Lumai,
To be on the same page, would you mind elaborating on the problem?
Is the problem by chance in the fact that Rider allows pressing the "Upgrade" button?
Did you consider using a custom NuGet feed? A responsible person might upload proven-to-work nuget packages there, so that developers might use this NuGet feed instead of NuGet.org.
Have a nice day!