10

I am using Visual Studio 2013 Pro and Team Foundation Server 2013. I have a .tfignore file with the following lines:

\packages
\<project name>\Bin
!\<project name>\Bin\*.refresh

Line 1 is not working but lines 2 and 3 are. The project name above is a website inside a solution. There is nothing else in this solution. There are nuget packages installed which automatically pull down when you publish or build the website. When that happens this package folder is created in the solution. It's not added to the solution explorer, it's just in the same folder as the solution when you look at the filer in file explorer.

Please let me know if there is any other information you need.

Andrei
  • 55,890
  • 9
  • 87
  • 108
hondaman2003
  • 177
  • 2
  • 10

2 Answers2

11

You can control this in NuGet.config.

Make sure the key "disableSourceControlIntegration" exists and is set to "true":

<solution>
    <add key="disableSourceControlIntegration" value="true" />
</solution>

References: http://docs.nuget.org/docs/Reference/Package-Restore http://docs.nuget.org/docs/Reference/NuGet-Config-Settings

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • 1
    In this project, I didn't enable nuget restore, it just happens automatically. Because of that, I also don't have a NuGet folder or config file. – hondaman2003 Dec 08 '14 at 14:41
  • 1
    This worked. What I did was, enable package restore so it would create this file for me. Then I deleted the nuget.exe and nuget.targets files. I checked in my changes. On another computer, I downloaded the project, built it so it would restore the packages. BANG! It worked, it didn't see that packages needed to be checked in. On my computer I just undid the packages folder so it didn't see that it needed to be checked in and it never came back. – hondaman2003 Dec 10 '14 at 23:38
  • 1
    Excellent. You asked this question just as I had been fighting with NuGet package restore with a customer, so the solution was on the tip of my brain. :) – Daniel Mann Dec 10 '14 at 23:47
2

If your packages are already in TFS, you should first "undo pending changes" on your local, delete them from TFS Source files and then, check in In Visual Studio. That will removed the packages from the server and will not ask to check them in again.

Hernan
  • 163
  • 2
  • 6