我想使用 C# 代码从 Visual Studio 外部打开工作项。是否可以?
我尝试过这个:
IWorkItemDocument widoc = null;
try
{
string tfsName = "http://rd-tfs-no2:8080/tfs/siproducts";
var projectCollectionUri = new Uri(tfsName);
var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(projectCollectionUri, new UICredentialsProvider());
projectCollection.EnsureAuthenticated();
DocumentService docService = (DocumentService)Package.GetGlobalService(typeof(DocumentService));
widoc = docService.GetWorkItem(projectCollection, id,this);
docService.ShowWorkItem(widoc);
}
finally
{
widoc.Release(this);
}
但帮助较少我得到 docService 的空值。
有什么好的建议吗?
The Package
仅当您使用 Visual Studio 插件时才有效。如果您正在寻找一种显示工作项的方法,您可以通过将字段映射到 winform/WPF 应用程序来实现,或者通过 shell 到 Internet Explorer 并将工作项 ID 传递到基于 Web 的 URL 中来实现。观众。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)