I want to open a work item from an external visual studio using C # code. Is it possible?
I tried with this:
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); }
But don't help while I get a null value for docService.
Any good suggestion?
source share