TFS 中 NuGet 包文件夹的正确 tfignore 是什么?

What is the proper tfignore for NuGet packages folder in TFS?

我的 TFS 存储库中有一个共享的 NuGet packages 文件夹,我希望 TFS 忽略此文件夹中的额外文件。

目前这是我的 tfignore 文件的内容,但我认为我们忽略了一些事情:

# NuGet autogenerate files

*.nupkg
*.nuget.props
*.nuget.targets
project.lock.json
project.assets.json

# Unwanted files (everything except for DLL)

*.js
*.ps1
*.p7s
*.transform
*.css
*.eot
*.svg
*.ttf
*.woff
*.map
*.xml
*.xdt
*.pp
*.props
*.rsp
*.targets
*.config
*.ini
*.txt
*.rtf

例如,根据 this answer

,似乎 nukpg 应该存在于所有机器上

为此,最少且正确的 tfignore 内容是什么?

nukpg 是包,您肯定需要忽略它们而不是将它们签入 TFS(在构建期间您 运行 nuget restore)。

Microsoft here 为 NuGet 推荐此 .tfignore

 # 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

# Exclude package target files which may be required for MSBuild, again prefixing the folder name as needed.
!packages/*.targets

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