3

I have seen few web posts and solutions but do not seem to work. Am i missing the obvious? this is what I have

At Solution level and not where the package resides I have a folder like the pic below

enter image description here

.tfignore contains the following

# Ignore NuGet Packages
    *.nupkg   

    # Ignore the NuGet packages folder in the root of the repository. If needed, prefix 'packages'
    # with additional folder names if it's not in the same folder as .tfignore.   
    packages


    # Omit temporary files
    project.lock.json
    project.assets.json
    *.nuget.props

nuget.config.xml contains

        <?xml version="1.0" encoding="utf-8"?>
        <configuration>
          <solution>
            <add key="disableSourceControlIntegration" value="true" />
          </solution>
        </configuration>

When I try to checkin items in visual studio 2017 it still shows all the packages.

Can somebody help with what I am doing wrong?

thanks

developer9969
  • 4,628
  • 6
  • 40
  • 88

2 Answers2

8

According to your screenshot, you are not using the correctly .tfignore file. This file does not have any suffix. One way to create it, suggest you to rename a new.txt file with "tfignore." It will auto change to right .tfignore file.

You can also use the auto automatically generated .tfignore file, follow below steps in my answer here.

More detail info about the .tfignore file please refer this tutorial.

Note: This .tfignore file will not affect with those files already in source control. You need to remove them from source control first. Also make sure your .tfignore files have checked in source control.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • thanks for your reply. i wondered about the "." after are you saying that the file should be named ".tfignore."? could you clarify what do you mean by "files already in source control"? are you talking about packages? many thanks – developer9969 Mar 16 '18 at 12:42
  • @developer9969 The txt file is `XX.TXT` you could just delete the TXT not `.TXT` and with `.tfignore.`, the file will auto change to the right ignore file. Yeah, I'm talking about the files you want to exclude(not check in source control such as packages in your case), for example if you already have the file A.CS in source control and want to exclude this file. Even though you have add the file name in your `.tfignore` file, the file will also appear in pending changes. – PatrickLu-MSFT Mar 16 '18 at 12:55
1
  1. In my opinion .tfignore should be located in solution folder directly and the file name is .tfignore and not .tfignore.txt
  2. The nuget config name is NuGet.config and not nuget.config.xml
  3. If packages are installed before .tfignore created, then you have may be to "undo" package folder first in Source Control explorer.
  4. Personally I would ignore the entire nuget packages folder with exception of targets
Paul S.
  • 35
  • 6