Feb 18, 2015 at 8:04 PM
Edited Feb 23, 2015 at 8:40 PM
Here's the deal: We have to tell both NuGet and
TFS to ignore the packages, because NuGet is trying to do source-control related stuff that it absolutely shouldn't be doing (bad form, Microsoft!). So you have to do two things.
First, add a file named
. It's contents should be as follows:
Boom. That tells TFS to ignore your packages folder. Now, you would think
that this would also ignore the
file. But it won't. Why? Who knows, the ways of Microsoft are strange and mysterious. Actually, I think it's part of the NuGet stuff I outline below, but if that ever gets fixed in the future and you want to keep the
file instead of letting VS regenerate it, you should be able to use this:
OK, so now we have out
file and TFS is ignoring your packages. Everything is fine, right?
, because NuGet is mucking around with your source control and adding the packages to your pending changes. So now let's tell NuGet to cut it out already.
Create a folder called
and put it in the root of your solution folder. Now, create a file called
, and put it in this new folder. It's contents should look like this:
<?xml version="1.0" encoding="utf-8"?>
<add key="disableSourceControlIntegration" value="true" />
OK, now TFS should be ignoring your packages!
One final thing, though: remember to add the
files to source control (not strictly necessary, but you want to make sure others on your team get these, and that you get it next time you do a fresh download). You also probably want to delete the packages folder from TFS if it exists there
The nuget.config file MUST go in the .nuget folder. Even if you already have a nuget.config file in the root of your solution folder (because, say, your company has an internal nuget feed). Yes, that means you'll have two nuget.config
files, one in the .nuget folder and one in the solution root. My testing indicates that's the way it has to be.