【发布时间】:2010-03-23 17:49:48
【问题描述】:
我正在开发一个 TFS 工具来帮助我们公司的开发人员。
该工具需要能够像在源代码管理资源管理器中一样“浏览”TFS 服务器。我相信通过使用 VersionControlExt.Explorer.SelectedItems,会弹出一个 UI,使用户能够浏览 TFS 服务器(如果我错了,请纠正我)。
但是,VersionControlExt 只能在 Visual Studio(又名插件)中开发时访问。不幸的是,我正在开发一个不能在 VS 中运行的 Windows 应用程序。
所以问题是,我可以在 Visual Studio 之外使用 VersionControlExt 吗?如果是,怎么做?
Here's 尝试在 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);
【问题讨论】:
-
只是好奇,为什么不用MS提供的网页版,TFS2010默认安装也包含在内:msdn.microsoft.com/en-us/teamsystem/bb980951.aspx我很好奇,因为我们也有类似的情况,网页需要什么版本不符合?
-
我们还计划将此工具整合到我们的构建系统中。请注意,我们的构建系统是从 1995 年开始的,并且仍然使用批处理文件(不是 TFS 构建系统)。