TJB
TJB

Reputation: 13497

NuGet: Difference in behavior between Update-Package and nuget.exe update?

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.

My 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

Answers (1)

glopes
glopes

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:

  1. VS Package Manager Console and nuget.exe do have different behaviors and seem to be updated independently (which is very unfortunate).

  2. 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).

  3. 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

Related Questions