none
How can we tell TFS to add files added to a project?

    Question

  • Hi all;

    We uses a product for our localization that creates the localized resource files and adds them to the .csproj files. However, it does not tell TFS about them. Is there a way to have TFS scan the projects and add any files that are part of the project that are not already in TFS?

    thanks - dave


    The future of B.I. - Raw & Uncut
    Tuesday, September 06, 2011 10:28 PM

Answers

  • Hi Dave,

     

    Thanks for your post.

     

    As our members said, TFS don’t support to scan the workspace folder automatically to check if there have new files be added.

     

    You can add files into Projects or Team Projects’ workspace folder on your local machine, then right-click Projects or Team Projects under Source Control Explorer and select Add Items to Folder to add your files.    


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by DavidThi808 Thursday, September 08, 2011 7:25 PM
    Wednesday, September 07, 2011 8:20 AM
    Moderator
  • Dave,

    From a VS 2010 command prompt, navigate to the root directory and run

    tf add *.<file extension> /recursive

    This will add all the <file extension> files that are not already in version control to your pending changes window.

    With the UI, you can only set exclude file types. But in the next window, you could sort by type name and exclude the rest.

     

    Thanks,

    Nivesh.

    Sirk Technologies LLC 

    Smart. Simple. Strategic.

    www.sirktech.com

    • Marked as answer by DavidThi808 Thursday, September 08, 2011 7:26 PM
    Thursday, September 08, 2011 1:18 AM
  • Hi Dave,

     

    After you installed TFS Power Tools on your local machine, you also can right-click on workspace folder(team project or project folder) and select Team Foundation Server>>Add… to add files.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by DavidThi808 Thursday, September 08, 2011 7:26 PM
    Thursday, September 08, 2011 2:50 AM
    Moderator

All replies

  • Unfortunately TFS will not auto scan to see the new files added, you will have to add the new files to the project manually.
    Please remember to mark the replies as answers if they help.

    Tarun Arora

    Blog: http://geekswithblogs.net/TarunArora  Subscribe in a reader

    Wednesday, September 07, 2011 12:31 AM
  • Hi;

    What if I disconnect the network cable and then open Visual Studio? It figures out it's not connected. I can add the files then exit, re-connect, and start VS again. Will that cause me any problems?

    There are hundreds of files so doing this by hand will be a royal PITA.

    thanks - dave


    The future of B.I. - Raw & Uncut
    Wednesday, September 07, 2011 1:32 AM
  • Dave,

    I assume the files are showing up in the project file and are there on your local workspace, but are not being added to version control.

    TFS will not scan your workspace for newly added files OR files that have been modified without being checked-out, when it gets back online.

     

    Have you tried adding the files directly into version control from a higher version control folder, filtering by extensions, if that works for you. This will only add files that are currently not in version control.

    If all generated files are in the MyProject version control folder in your local workspace for example (or even team project), you could right click on MyProject in source control explorer, add items to folder and set filters. You can also do this through the tf add command line (with recursive option).

     

    If you have access to the localization automation, you could also look at doing a tf add on the file when it's generated/added to the project file.

     

    Thanks,

    Nivesh.

     

    Sirk Technologies LLC

    Smart. Simple. Strategic.

    www.sirktech.com

    • Marked as answer by DavidThi808 Wednesday, September 07, 2011 3:36 PM
    • Unmarked as answer by DavidThi808 Wednesday, September 07, 2011 10:28 PM
    Wednesday, September 07, 2011 2:46 AM
  • Hi Dave,

     

    Thanks for your post.

     

    As our members said, TFS don’t support to scan the workspace folder automatically to check if there have new files be added.

     

    You can add files into Projects or Team Projects’ workspace folder on your local machine, then right-click Projects or Team Projects under Source Control Explorer and select Add Items to Folder to add your files.    


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by DavidThi808 Thursday, September 08, 2011 7:25 PM
    Wednesday, September 07, 2011 8:20 AM
    Moderator
  • Ok will do. This is hundreds of files across 30 directories so I hope I can come up with a way to do it using a filter from the root directory.

    thanks - dave


    The future of B.I. - Raw & Uncut
    Wednesday, September 07, 2011 3:36 PM
  • Hi;

    How do I add files filtering by extension?

    thanks - dave


    The future of B.I. - Raw & Uncut
    Wednesday, September 07, 2011 10:28 PM
  • Dave,

    From a VS 2010 command prompt, navigate to the root directory and run

    tf add *.<file extension> /recursive

    This will add all the <file extension> files that are not already in version control to your pending changes window.

    With the UI, you can only set exclude file types. But in the next window, you could sort by type name and exclude the rest.

     

    Thanks,

    Nivesh.

    Sirk Technologies LLC 

    Smart. Simple. Strategic.

    www.sirktech.com

    • Marked as answer by DavidThi808 Thursday, September 08, 2011 7:26 PM
    Thursday, September 08, 2011 1:18 AM
  • Hi Dave,

     

    After you installed TFS Power Tools on your local machine, you also can right-click on workspace folder(team project or project folder) and select Team Foundation Server>>Add… to add files.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by DavidThi808 Thursday, September 08, 2011 7:26 PM
    Thursday, September 08, 2011 2:50 AM
    Moderator
  • Thursday, September 08, 2011 7:26 PM