Visual Studio and TFS, detect changes outside Visu

2019-05-24 05:05发布

问题:

This question already has an answer here:

  • Force TFS to detect changes 7 answers

Im Working with Visual Studio 2015 with an ASP.NET Web Application, with Umbraco and uSync installed. It's not essential what uSync and Umbraco are, but when I start the project and create a Template in Umbraco, uSync writes "export"-files to a specific folder in the project path.

Now Visual Studio doesn't list the new, changed or deleted files under pending changes, so i can't check-in my changes.

Is there a way to tell Visual Studio to always track created, removed or changed files in specific folders of the project?

Yeah, i could always manually include the files to the project, but this could cause errors when I miss a file or when someone works with this solution and doesn't know he has to include them manually.

There are also other files that I don't need to check in so I need a solution to specify, which folders Visual Studio should track and not something how to track everything going on in the whole project path.

回答1:

You just need to create a local workspace and not a server Workspace.

Then all files edited outside your solution get detected:

Picture: Pending Changes with detected adds

Then i include the detected adds, so they are under Included Changes. Now i can check-in all the changed files, but at this time they are in source control but not included to the project. So I add the lines like described at this link:

http://www.mattburkedev.com/automatically-include-all-files-in-folder-in-visual-studio/

Then I unload the Project and Reload it. The files are now included.

So next time I add files in Umbraco: just add detected adds in Pending Changes and reload project, everything done.



回答2:

Well, no. That's the nature of a Web Application project type. But if for instance you used a Website project instead, all files in the main folder would automatically be part of your project.