简体   繁体   中英

Using Solution explorer vs using Source control explorer when working with TFS

Trying to use TFS 2010, I got confused with what option to use when working with local copies of files in Visual Studio 2010: Solution explorer or Source control explorer .

The Solution explorer is a more natural way of doing this (at least for starters like me) but using Source control explorer seems to be more convenient and productive. There are more options available, but clicking a file you still opens the local copy of it.

What are advantages of using one approach over the other?
Should I still go File => Open => Project/Solution or should I better use Team Explorer => Source Control (it seems even faster)?
What are situations when using Solution explorer is obviously better (or even the only) option?

Solution explorer is for working with solution, that is for development. When you are opening file from Solution explorer , you are opening a part of your project - VS takes into account what assemblies, namespaces etc. should be visible from this file, which gives you intellisense. Furthermore, context menus on Solution explorer are targeted at development process - notice all these "Build", "Rebuild", "Set as start up project" and so on.

When you are viewing your solution in Solution explorer , you see only those parts that are used in source code, I mean compiled files, resources etc. Moreover there might be a situation when you will have file included in the solution, but not included in source control, and the only place where one can see it is in Solution explorer .

Source control explorer on the other hand is for working with source control. It allows you adding and removing files in repository, checking in and checking out, updates etc. It has nothing to do with the development process directly - for example Source control explorer won't give you an opportunity to compile anything. Opening file in Source control explorer opens it as a single file - yes, it is still editable, but it does not now about the context, does not give you intellisense and so on.

When you are viewing your sources in Source control explorer , you are not limited to the individual solution. Imagine the situation when you have also folder with project documents (specs, mockups) in source control. You might not what to include them in your solution, but you still need to control them somehow - update their versions in source control, add new ones and so on. It is not possible while you are in Solution explorer , since you cannot see anything beyond the solution itself. Therefore the only place where you can work with these files is Source control explorer .

To sum up, Solution explorer is for working with source code, that is for development, Source control explorer is for working with repository.

Solution explorer is normally used when you are doing some work locally. You will check out your file do whatever changes you want and check in the file. But getting latest version from solution explore can be tricky some times. Source control explorer should preferably be used to take latest version of files. So in my case, the first thing that I will do start of the day is use source control explorer to get latest files and then use solution explorer throughout the day to interact with TFS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM