Why doesn't my .tfignore file ignore my packag

2020-08-20 11:21发布

问题:

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.

回答1:

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



回答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.