Getting a dte2 or TeamFoundationServerExt object in a VS package project?

I am working on a Visual Studio package project. This project requires a connection to our TFS. To read the current connection, I will need a TeamFoundationServerExt object, which I must get from the dte2 object.

Now I have found hundreds of examples, and most of them work with the variable "_application", which seems to be automatically populated, but, of course, not for the type of project "Visual Studio Package".

How can I get a TeamFoundationServerExt object for the current VS2010?

+3
source share
1 answer

You should be able to do the following from VSPackage to get the current DTE object:

DTE2 dte = ServiceProvider.GlobalProvider.GetService(typeof(SDTE)) as DTE2;

, "Zombie" (.. ), GetService.

+9

Source: https://habr.com/ru/post/1791163/


All Articles