Search code examples
visual-studio-2013tfs

TFS source control - new files not automatically detected as pending changes


As per the tags, I'm using VS2013 and TFS2013.

There are multiple projects in the solution: Model, Presenter, View, etc. All other projects are working as expected in terms of source control operations.

Problems with the Model project:

  • Adding a new file via Solution Explorer isn't automatically detected as a pending change
  • Deleting a file isn't detected either

Other source control operations work fine for the Model project, such as:

  • Get latest version
  • Edit detection for existing files (including changes to the csproj file when a new file is added)
  • Checking in pending changes

The csproj file would show up in pending changes with the newly added file listed in it, but the new file itself isn't showing up, therefore causing build errors on other developers' machines if only the csproj changes are checked in.

The workaround is to find the added file in solution explorer and Add via context menu, this will make it appear as a pending change. But this process should be automatic as per the other projects.

Noticed that there is no .vspscc file for the Model project while other projects have one each.

Any help appreciated. Thanks.


Solution

  • I would unbind and rebind the problem project and try again:

    To unbind a solution or project from source control

    • In Visual Studio, open Solution Explorer and select a solution or project to unbind.

    • On the File menu, click Source Control, then Change Source Control.

    • In the Change Source Control dialog box, click Unbind.

    To bind a solution or project to source control

    • In Visual Studio, open Solution Explorer and select a solution or project to bind.

    • On the File menu, click Source Control, then Change Source Control.

    • In the Change Source Control dialog box, click Bind.

    • Select the database and location to which to bind, and click OK.

    • Click OK.

    You might need to go to Advanced to find the Change Source Control option

    https://msdn.microsoft.com/en-us/library/0eh3790h%28v=vs.90%29.aspx