我正在开发一个TFS工具来协助我们公司的开发人员。在Visual Studio外部使用VersionControlExt.Explorer
这个工具需要能够像在源代码管理资源管理器中一样“浏览”TFS服务器。我相信通过使用VersionControlExt.Explorer.SelectedItems,将弹出一个用户界面,使用户能够浏览TFS服务器(如果我错了,请纠正我)。
但是,只有在Visual Studio(又名插件)内开发时才可以访问VersionControlExt。不幸的是,我正在开发一个Windows应用程序,它赢得了VS.
所以问题是,我可以在Visual Studio之外使用VersionControlExt吗?如果是,如何?
Here's上使用Changset详细信息对话框的Visual Studio之外的企图
string path = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Assembly vcControls = Assembly.LoadFile(path + @"\Microsoft.TeamFoundation.VersionControl.Controls.dll");
Assembly vcClient = Assembly.LoadFile(path + @"\Microsoft.TeamFoundation.VersionControl.Client.dll");
Type dialogChangesetDetailsType = vcControls.GetType("Microsoft.TeamFoundation.VersionControl.Controls.DialogChangesetDetails",true);
Type[] ctorTypes = new Type[3] {vcClient.GetType("Microsoft.TeamFoundation.VersionControl.Client.VersionControlSever"),
vcClient.GetType("Microsoft.TeamFoundation.VersionControl.Client.Changeset"), typeof(System.Boolean)};
ConstructorInfo ctorInfo = dialogChangesetDetailsType.GetConstructor(ctorTypes);
Object[] ctorObjects = new Object[3] {VersionControlHelper.CurrentVersionControlServer, uc.ChangeSet, true};
Object oDialog = ctorInfo.Invoke(ctorObjects);
dialogChangesetDetailsType.InvokeMember("ShowDialog", BindingFlags.InvokeMethod, null, oDialog, null);
只是好奇,为什么不使用由微软提供的网络版本,包括在默认与TFS2010安装以及:http://msdn.microsoft.com/en-us/teamsystem/bb980951.aspx 我很好奇,因为我们有类似的情况,网络版本没有满足什么需求? – 2010-01-22 13:31:59
也有计划在我们的构建系统中加入这个工具。请注意,我们的构建系统是从1995年开始的,仍然使用批处理文件(而不是TFS构建系统)。 – Ian 2010-01-24 09:29:35