For those wondering why this is useful, it's likely they haven't worked on large projects. In such projects, it's common for different components to use varying versions of the same library, leading to compatibility issues and errors.
nuget package manager, at solution level gives warnings when you have mismatches which is enough for me tbh, nevertheless this can be helpfull in keeping things clean. downside is when adding a new package you will need to manually add it to the buildprops file.
@Anno_Nymous Actually - when I recently tried this you can just install the NuGet and it will be added to the packages props file correctly. Maybe it was a recent VS update, can't tell
yes it will, however so will using different version of the same package, especially if the projects have relations with each-other. you should fix version mismatches it can give headaches later on.
It's generally better practice to keep package versions the same across projects. Paket is a good alternative, it provides dependency groups when that extra finesse is required.
@@edgarskurpnieks476 Can be solution level, or folder level. I think this is meant for a single solution, but you could share it if you import the same props file in all solutions.
Kind of. You can manage nuget packages at the solution level. It will tell you which version is installed in each project and allow you to install/update accordingly.
Yes, go to tools > nuget package manager > manage package for solution. here you have your central package managment. you can see all your packages, see what is the latest version, see if there are updates, see if packages are deprecated, etc etc. It's the industry standard, and yes also for large projects. it warns you for if you have different versions for the same package across projects, the managepackeversioncentrally just uses 1 file with the version and packages for all files (so you wont get version mismatches)
@@thomasvlima no, you have to add the new file, name it add the projects. end edit all project files.after that you can use nuget package managment as normal, however adding a new package need manual editing again. so it does add complexity.
Wrote a blog post here: www.milanjovanovic.tech/blog/central-package-management-in-net-simplify-nuget-dependencies There's a tool to help you migrate. Then you can continue working from the GUI
@@Code_Bits sometimes you need the same package in multiple project of the solution, this will prevent have for instance version 2.1.1 of a package in project A, while having 2.1.3 in project B for example.
For those wondering why this is useful, it's likely they haven't worked on large projects. In such projects, it's common for different components to use varying versions of the same library, leading to compatibility issues and errors.
nuget package manager, at solution level gives warnings when you have mismatches which is enough for me tbh, nevertheless this can be helpfull in keeping things clean. downside is when adding a new package you will need to manually add it to the buildprops file.
@@Anno_NymousI think VS as well as Rider do detect/support central package management and they will add it accordingly.
Damn. A feature just short of what is actually needed.
@Anno_Nymous Actually - when I recently tried this you can just install the NuGet and it will be added to the packages props file correctly. Maybe it was a recent VS update, can't tell
@@MilanJovanovicTech i think i prefer a private nuget with allowed versions
I don't get it. What if I need to have multiple versions of the same package across different projects? Wouldn't that complicate things even further?
yes it will, however so will using different version of the same package, especially if the projects have relations with each-other. you should fix version mismatches it can give headaches later on.
It's generally better practice to keep package versions the same across projects. Paket is a good alternative, it provides dependency groups when that extra finesse is required.
No - you can still override the package version where needed
that is why you need it
Is this for solution level for all projects within the solution?
Yes
How will it benefit?
If you have 5 projects, you can make sure all those projects have the same version of a package.
Managing package versions in one place - works really nice for large projects
Does that props file have to be located in the same solution? If i have multiple repos with multiple solutions, what then?
No more consolidating packages
@@edgarskurpnieks476 Can be solution level, or folder level. I think this is meant for a single solution, but you could share it if you import the same props file in all solutions.
Is it ready for using in production?
@@chenz2584 Yes
It's a shame Paket isn't more popular, but this is OK as an alternative I guess
You can't really compete with NuGet in this space
@MilanJovanovicTech have you tried Paket?
Is there any way to do that from the Visual Studio GUI already?
Kind of. You can manage nuget packages at the solution level. It will tell you which version is installed in each project and allow you to install/update accordingly.
@sweeperq yes, but its another feature. I was asking about the feature presented in the vídeo.
Yes, go to tools > nuget package manager > manage package for solution. here you have your central package managment. you can see all your packages, see what is the latest version, see if there are updates, see if packages are deprecated, etc etc. It's the industry standard, and yes also for large projects. it warns you for if you have different versions for the same package across projects, the managepackeversioncentrally just uses 1 file with the version and packages for all files (so you wont get version mismatches)
@@thomasvlima no, you have to add the new file, name it add the projects. end edit all project files.after that you can use nuget package managment as normal, however adding a new package need manual editing again. so it does add complexity.
Wrote a blog post here: www.milanjovanovic.tech/blog/central-package-management-in-net-simplify-nuget-dependencies
There's a tool to help you migrate. Then you can continue working from the GUI
In the nuget package manager, you can already install/update packages for all projects. I don't see any advantage here
Thats not the same
@@Code_Bits sometimes you need the same package in multiple project of the solution, this will prevent have for instance version 2.1.1 of a package in project A, while having 2.1.3 in project B for example.
Read this: www.milanjovanovic.tech/blog/central-package-management-in-net-simplify-nuget-dependencies