SourceGear Vault and NuGet

Sep 7, 2011 at 1:20 PM

Anyone out there using Vault and NuGet together?  I may be missing something but it feels pretty painful.  If I want to do anything with NuGet I have to manually check out the package.config files and then leave VS, open the Vault Client and check-out the packages folder.  I can learn to live with it but it would be nice if I didn't have to.

Sep 8, 2011 at 3:58 AM

If you don't commit the packages folder, that might help with part of the problem. That being said, I'm not familiar with Vault, so there may be other things going on.

Sep 15, 2011 at 3:57 PM

I've got the same problems here as well:

  • NuGet does not check out the packages.config file automatically, which means it (partially!) rolls back the package install (it does not roll back the added reference).
  • However, when you do check out the packages.config, I do not seem to have any problems adding new packages: I don't need to check out the packages folder. I do need to check out the packages folder when packages are removed or when they change (under the same package folder name, which I don't think should happen under normal circumstances).
  • Also, adding packages means that I have to add the new folders in the packages folder by hand in the Vault Client, which is a tad cumbersome, as the easiest way of doing that is to add them one by one.
  • Finally, the Vault-Visual Studio integration does not think of the packages folder as being part of the solution, so it does not get a latest version of this folder when you ask for a latest version of the solution (meaning packages will be missing for other team members, unless they ask for a latest version from the Vault Client).

I've thought about abusing a Web Site project mapped to the packages folder would make the experience less painful. However, Vault does not seem to detect added package folders recursively unless you start refreshing and expanding them by hand, which makes things even more painful to add to the repository. It would solve the "Get Latest Version" problem for the packages folder, but it's a horrid abuse of the Web Site feature.

It's a pretty painful experience indeed.

Sep 15, 2011 at 6:29 PM

Did you try not committing packages per my previous reply?

You may also want to open an issue to track the overall problem with Vault.

Sep 28, 2011 at 12:01 AM

Not committing files seems to work. (Note to self: do use the suggested solution folder .nuget for the NuGet files, otherwise it's not loaded in time by VS and the dependent projects will fail to load.) It works better than I expected, but checking in NuGet.exe feels dirty somehow. Let's hope for NuGet to be better integrated in VS / MSBuild, so you no longer need to do this final fix up.

I'm still not completely sold, as you're now creating yet another dependency on one or more other repositories than your source repository. Not being able to build when the NuGet gallery servers are down, or you've got no Internet connection--not so nice.

But at least it works as advertised, and keeps the source repository nice and tidy. I'd hate checking in the unpacked packages folders, as they often contain several framework specific lib folders, which are unlikely to be needed, and the .nupkg is still added anyway. A waste of space, IMHO.

I've already filed a report on the checkout bug. Let's see what happens.

Sep 28, 2011 at 1:30 AM

Note that you only need to be connected the first time you build. After that, you have a local copy of the packages and nuget.exe does not work at all.