Exclude packages directory from TFS

Topics: General
May 2, 2012 at 10:51 PM

If anyone is using NuGet in a solution that is being controlled by TFS 2010, I would be interested to know how you are excluding the packages directory from source control. I was able to add "packages" to the "Automatically exclude from source control" list in the "Add to Source Control" dialog in TFS, but it seems to be completely ignored. If I build the solution, which brings down the dependencies since package restore is enabled, then close the solution and re-open it, the packages directory appears as being added in the Source Control Explorer window. I feel like there has to be a way to exclude the directory, but I've been unsuccessful so far. Requiring each dev to undo the adding of the packages directory is not a solution.