Search code examples
visual-studiovisual-studio-2015tfstfvc

Visual Studio 2015 added files not being added to source control automatically in release branch


We have noticed in Visual Studio 2015 since Update 3 that any files or projects that get added to our solution no longer get picked up by source control (TFS) automatically:

Image of solution explorer showing missing "+" sign

When we right click the Person.cs file and select "Add files to Source Control" we get the following dialog:

Image of source control dialog when trying to add file

I have seen some folks talk about using the .tfignore file to override this behavior but I have had no success at all with this approach.

Any help that can be provided would be great.


Solution

  • This is a known behavior and only occurs at Visual Studio 2015 Update 3 for a branch with "Release" name. Using Visual Studio 2015 Update 2, everything is ok.

    Folders called Release and their contents is automatically excluded from TFS (along with Debug and lots of file types). Just as your folks suggested, you could also override this for particular folders by creating a .tfignore file, detail info please refer this link: Customize which files are ignored by version control

    Customize which files are ignored by version control

    By default certain types of files (for example, .dll files) are ignored by version control. As a result:

    When you add ignored files to folders that are mapped in a local workspace, they do not appear in the Pending Changes page in Team Explorer.

    When you try to add ignored files using the Add to Source Control dialog box (for example by dragging them into Source Control Explorer), they automatically appear in the Excluded items tab.

    You can configure which kinds of files are ignored by placing text file called .tfignore in the folder where you want rules to apply. The effects of the .tfignore file are recursive. However, you can create .tfignore files in sub-folders to override the effects of a .tfignore file in a parent folder.

    The related .tfignore file rules may help you:

    .tfignore file rules

    ! negates a filespec (files that match the pattern are not ignored)

    For example:

    Do not ignore .dll files in this folder nor in any of its sub-folders
    !*.dll