简体   繁体   English

在使用TFS时,使用Solution explorer与使用Source控件资源管理器

[英]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 . 尝试使用TFS 2010时,我对在Visual Studio 2010中使用本地文件副本时使用的选项感到困惑: 解决方案资源管理器源代码管理资源管理器

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. 解决方案资源管理器是一种更自然的方式(至少对于像我这样的初学者),但使用Source控件资源管理器似乎更方便和高效。 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)? 我还应该去File => Open => Project / Solution,还是应该更好地使用Team Explorer => Source Control (看起来更快)?
What are situations when using Solution explorer is obviously better (or even the only) option? 使用Solution explorer时的情况显然是更好(甚至是唯一)选项?

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. 当您从解决方案资源管理器中打开文件时,您正在打开项目的一部分 - VS会考虑从此文件中可以看到哪些程序集,名称空间等,从而为您提供智能感知。 Furthermore, context menus on Solution explorer are targeted at development process - notice all these "Build", "Rebuild", "Set as start up project" and so on. 此外,Solution explorer上的上下文菜单针对开发过程 - 请注意所有这些“Build”,“Rebuild”,“Set as start up project”等等。

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. Source control explorer中打开文件将其作为单个文件打开 - 是的,它仍然是可编辑的,但它现在不关于上下文,不会给你智能感知等等。

When you are viewing your sources in Source control explorer , you are not limited to the individual solution. Source control explorer中查看源时,您不仅限于单个解决方案。 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 . 因此,您可以使用这些文件的唯一位置是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用于处理源代码,即用于开发, Source control explorer用于处理存储库。

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. 所以在我的情况下,我将在今天开始做的第一件事是使用源代码控制资源管理器获取最新文件,然后使用解决方案资源管理器全天与TFS进行交互。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TFS2008和VS2008:从解决方案资源管理器中删除的文件仍显示在源代码管理资源管理器中 - TFS2008 & VS2008 : File deleted from Solution Explorer still appears in Source Control Explorer TFS中的奇怪问题-源代码管理资源管理器未加载 - Weird issue in TFS - Source Control Explorer not loading 通过本地路径而不是TFS路径在源代码管理资源管理器中导航 - Navigate in source control explorer by local path instead of TFS path 在解决方案资源管理器下的 Visual Studio 解决方案中创建的文件夹未出现在源代码管理资源管理器中 - Folders created in visual studio solution under solution explorer not appearing in source control explorer Visual Studio 2019 - 在解决方案资源管理器中查找不在源代码管理中的项目 - Visual Studio 2019 - Find items not in source control in Solution Explorer VS -TFS错误_在解决方案资源管理器中未显示解决方案的下拉菜单“查看历史记录” - VS -TFS bug_ Not show dropdown menu “View history” of solution in Solution Explorer VS2012-在特定项目/节点上打开了Source Control Explorer - VS2012 - Source Control Explorer open at a specfic project/node Visual Studio TFS工作区和解决方案资源管理器 - Visual Studio TFS workspace and solution explorer Visual Studio解决方案资源管理器中没有TFS连接 - No TFS-connection in Visual Studio Solution Explorer Visual Studio 2022 Professional 源代码管理资源管理器无法正常工作 - Visual Studio 2022 Professional Source Control Explorer Stuck in Working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM