2

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.

Shiffty
  • 2,086
  • 2
  • 26
  • 31
Silv
  • 673
  • 5
  • 19

2 Answers2

4

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.

Silv
  • 673
  • 5
  • 19
  • If you find part of an answer to be helpful, either add the helpful info to your question or ask for the answer to be edited accordingly. Don't just answer your own question using part of someone elses answer? – Jannik Anker Jul 05 '16 at 13:31
  • I found the answer about detecting changes outside Visual Studio and mixing it with your link is the answer to my queston. So why not answering my question myself with your link and some additional information i found elswhere... – Silv Jul 05 '16 at 13:38
  • Never mind. It was no more than a googling from my side, I just didn't think this was how we did things on Stack Overflow, but I might be mistaken: http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/ – Jannik Anker Jul 05 '16 at 13:48
  • I gave an upvote on your comment ;-) – Silv Jul 11 '16 at 07:03
-3

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.

Jannik Anker
  • 3,320
  • 1
  • 13
  • 21
  • But there must be someone who experienced the same problem. How should I handle this? – Silv Jul 05 '16 at 08:09
  • It's not a problem, it's how it's supposed to be :-) Personally, I like that I have control over what is in my solution/project/source control. – Jannik Anker Jul 05 '16 at 08:10
  • that totally makes sense. I also got some files, that shouldn't get included. But i want an option that i can CONTROL from which folders all new files should get included. So you don't loose control. You just set your desired settings. – Silv Jul 05 '16 at 08:42
  • And that option does not exist, to my knowledge, because Web Application projects are the way they are. Maybe it's an idea for a VS extension though? Haven't seen any existing ones. – Jannik Anker Jul 05 '16 at 08:44
  • 1
    Hm. http://jamesrpatterson.com/blog/automatic-include-in-project-for-visual-studio maybe? This is more of the same, I think: http://www.mattburkedev.com/automatically-include-all-files-in-folder-in-visual-studio/ – Jannik Anker Jul 05 '16 at 08:47
  • This is not a question of Visual Studio or project types, it's a question of how TFVC source control workspace mappings function. – Daniel Mann Jul 05 '16 at 18:13
  • Plus there is only legacy support for "Web Sites"...always use "Web Applications". – MrHinsh - Martin Hinshelwood Jul 10 '16 at 18:03