Reputation: 13497
I'm using NuGet to create a 'web framework' package containing code, master pages, css, javascript, etc.
In an attempt to speed up the build / test process I'm running nuget.exe update packages.config
but I've noticed that it behaves differently than the package manager console's Update-Package
command.
nuget.exe update
seems to leave the previous version of the package still installed, resulting in multiple versions of the package installed. This usually doesn't cause problems but the Package-Manager Get-Package
command shows many versions installed and sometimes the project will fail to build. Update-Package
actually uninstalls the package then reinstalls it, this is cleaner but slowerMy questions are:
1. Is there documentation about the difference / relationship between these commands
2. Is the nuget.exe update
behavior of installing multiple versions a bug?
3. Is there a better method for creating a package in one project and updating it in another project in a fast & automated manner?
Upvotes: 1
Views: 477
Reputation: 4380
Unfortunately, there's not much official guidelines or documentation except from piecing together forum and work item threads.
Current package manager console behavior was first included as a result from discussion in this thread, which later derived in a work item (sorry, apparently not enough rep to post more links).
However, as others already noted, behavior is not consistent with nuget.exe
, where there's no such switch.
So, in answer to your questions:
VS Package Manager Console and nuget.exe
do have different behaviors and seem to be updated independently (which is very unfortunate).
nuget.exe
update behavior of installing multiple versions side-by-side has been a design feature from the start, as you can find from a comment on David Ebbo's blog about NuGet command line (again, I would have given you the link, but SO still doesn't trust me).
Unfortunately I haven't found anything about using package manager console cmdlets during build. What you could try is manually deleting all folders with your packageId on a build event and then packaging and installing using nuget.exe
. Essentially replicate what Update-Package
does manually, since as David Ebbo says, the way you uninstall a package through the command line interface is by, well, deleting the folder (again, can't post a reference, this is a bit annoying...)
Upvotes: 3