We have a Nuget package that has been developed in-house and adds a number of MVC-related assets to any project that pulls it in - an Index.cshtml
view in the Views\Home
folder, a HomeController
and Controllers
folder and a Content
folder with some static files in (amongst others).
Every time we create a new version of the package and pull it into a project that is under TFS source control, the current version of the package is uninstalled first (standard Nuget behaviour). This causes all of the assets to be placed into the pending delete state within source control. Whenever a folder is emptied of all files, that folder is also placed into the pending delete state.
When the new version of the Nuget package is then installed, package manager throws up errors because the assets it is trying to copy over are already set to delete, or the parent is set to delete in the case of folders.
Is there a way to deal with this situation, either by forcing TFS to effectively undelete the assets when installing the new package or not to delete them in the first place when uninstalling?