English 中文(简体)
NuGet and distributed version control (DVCS)
原标题:

I wonder if it is possible to use nuget to only store references to the required packages in version control (only the package.config and ignore the packages folder).

Is there a way to tell nuget to (re)download all the referenced packages in the various package.config files? Or something similar which could be put into a build script.

Update:

Seems that I m not the only one who requested this feature: See this work item (thanks to PHeiberg for the hint)

Update 2:

NuGet now has this feature builtin. See Using NuGet without committing packages to source control for details. All left is to add the packages directory to .gitignore or some equivalent of your VCS (/packages/ will do the trick if you have it in the root of your repository and are using git).

最佳回答
问题回答

I don t know about your first question.

As for having a CI server automatically update the packages, it s doable in theory. You could chain the "List-Package -Installed" and the "Update-Package" commands and have each package updated to the latest version. See the command reference for further details.

Scott Guthrie says this on the topic:

"You can integrate the command-line option with a CI solution and do an update-package command explicitly as part of your build/CI process to pull down updates. Frankly I m not sure that makes sense for the scenarios we are talking about, though, as typically you want some dev to decide before updating a core runtime dependency to a new version. NuPack s default model would have a developer use NuPack to install a library - and NuPack would automatically check in the package and dependencies to source control. That way another dev (or the CI server) wouldn t need to use NuPack again - they could just sync their source and build. But as I mentioned earlier - if you wanted to explicitly do an update as part of your CI process you could."

Edit:

After your comment I see what you re trying to achieve. I found this long thread in the NuPack discussions list about the issue. A solution will apparently not be part of v1. A custom build task in the CI of your choice and a config in your repo for it is the only solution I see. Please report back with your findings. You got me interested.

There is a current discussion about this question at Phil Haack s blog, where he is asking for feedback on how to tackle this question.





相关问题
Tracking Versions, Builds, Revisions, with TortiseSVN

I am the sole developer on a project and have been using tortoiseSVN for quite a while. Now Id like to start getting version information working correctly in the project I.E. show Major Version, Minor ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

How to handle different csproj [closed]

I am working in a team of five. We are working on a C# application with five csprojects. The problem is that for each csproject, each of my colleagues has their own ideas on how to reference a DLL; ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签