Search code examples
tfsvisual-studio-2017tfignore

TFS: Why is Cloak grayed out?


I'm on VS Community 2017.

I'm trying to permanently ignore the packages folder from being checked-in. I went to Source Control Explorer, but the Cloak option in the file/folder's context menu, under Advanced is grayed out:

enter image description here

I tried adding a .tfignore file in the root folder adding packages and /packages to it, but it didn't do the job.

Any ideas?


Solution

  • Cloaking is the process of defining which folders or files should be ** ignored by the workspace on your development machine.**

    Which may not be suitable for your situation. You could only cloak files/folders already in source control. If your packages folder is newly add in pending changes and not checked in, the cloak option should be grayed out.

    Give a try with declaring below instead of only ignore \packages in your .tfignore file and add a disableSourceControlIntegration in a NuGet.config file, try again.

    \packages
    !\packages\repositories.config
    

    For more detailed steps please refer to this question: Get TFS to ignore my packages folder

    Another way is only check the packages folder to TFS (without any files or sub-folders) and then do the cloaked operation.

    More info about the nuget package restore/TFS please refer this tutorial-- Package Restore with Team Foundation Build