Nuget : how to NOT remove old packages after package update?
A couple months ago we’ve started using Nuget in our ASP.NET MVC projects. We’re building a lot of applications that consist of several reusable compontents. For example:
But our team has grown a lot the last weeks and we’re experiencing some problems when merging packages. Everytime we update a package, the old version package is removed from the package folder. This is great, but it causes a lot of problems when merging/checkin into git (we use tortoiseGit). For Example:
Developer 1 updates the Authentication module in Application A to version 2.0 and checks this in. Developer 2 is also working on Application A and updates the Authentication module to version 2.1. Developer 1 checks in before Developer 2. When Developer 2 pulls the latest changes from git and tries to checkin his changes he will experience a lot of conflicts in the nuget packages folder because he doesnt have the files from version 2.0 in his package folder (TortoiseGit Error: FileNotFound). Now Developer 1 has to create the package folder in his local file system and mark it as deleted to be able to checkin in his changes.
This problem would be resolved if Nuget doesn’t delete old package folders on an update. Is this possible? In this scenario we would of course clean up old packages in the nuget package folder manually…
One Solution collect form web for “Nuget : how to NOT remove old packages after package update?”
It sounds like a better solution for your team would be to not include the packages folder in version control, and instead enable package restore.
If you use Nuget 2.7+ , visit this site