I've got a Windows Forms (.NET 4.8) application which is under source control on dev.azure.com. The project contains a packages folder set up by nuget but installed packages are being marked as pending check-ins despite having a .tfignore
file in project root expressly excluding them. I can't understand why.
I have the following .tfignore
file in the Project root (Ice
folder):
\packages
!\packages\repositories.config
\.vs
I have "Allow NuGet to download missing packages" and "Automatically check for missing packages during build in Visual Studio" both checked under Options.
I'm using Visual Studio 2019 Professional.
The project file is the legacy (ToolsVersion="12.0") format as I don't believe VS supports Windows Forms apps with the new version.
Any ideas why I can't get the folder to be ignored? Thanks guys.
NOTE:
A filespec is recursive unless prefixed by the \
character.
You are using an incorrect pattern in the .tfignore
file, the pattern "\packages
" generally only matches the files in the packages
folder, and not matches the files in the sub-folders of packages
.
If you want to match all the files and sub-folders in the packages
folder, you can set the pattern like as "packages
" or "packages\*
".
To view more details, you can see "Customize which files are ignored by version control".