微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – 如何从Visual Studio外部打开WorkItem(VS-Team Explorer)?

我想使用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的空值.

有什么好建议吗?

解决方法

该程序包仅在您使用Visual Studio插件时才有效.如果您正在寻找显示工作项的方法,您可以通过将字段映射到winform / WPF应用程序,或者通过外壳到Internet Explorer并将工作项ID传递到基于Web的URL来实现.观众.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐