Questions tagged [envdte]

EnvDTE is an assembly-wrapped COM library containing the objects and members for Visual Studio core automation.

The MSDN Documentation for EnvDTE says

EnvDTE is an assembly-wrapped COM library containing the objects and members for Visual Studio core automation.

572 questions
7
votes
1 answer

Re-load Unloaded Projects in EnvDTE

I have listed all the projects in my solution, using EnvDTE, but I found a bug in my code: I can't get the projects that are Unloaded. I found a way to skip the Unloaded projects: if (string.Compare(EnvDTE.Constants.vsProjectKindUnmodeled,…
Thalia
  • 13,637
  • 22
  • 96
  • 190
7
votes
5 answers

How do you check if a variable is used in a project programmatically?

In VB.NET (or C#) how can I determine programmatically if a public variable in class helper.vb is used anywhere within a project?
Kingamoon
  • 1,467
  • 1
  • 18
  • 32
6
votes
1 answer

How to Replace DTE2 in .NET Standard

It's been a while since .NET Standard is introduced by Microsoft. Earlier, if I wanted to obtain information about Project, Solution and other related objects (e.g solution path, projects in a solution, etc), I used DTE2 type which is an interface…
Mo Sadeghipour
  • 489
  • 8
  • 25
6
votes
2 answers

VS Extension: TextPoint.GreaterThan / LessThan very slow for large files

I'm working on a VS Extension that needs to be aware of which class member the text-cursor is currently located in (methods, properties, etc). It also needs an awareness of the parents (e.g. class, nested classes, etc). It needs to know the type,…
Adam Plocher
  • 13,994
  • 6
  • 46
  • 79
6
votes
1 answer

How do I prevent IVsBuildPropertyStorage.SetItemAttribute from escaping special characters?

I am working on a Visual Studio 2010 extension and I want to add an attribute to an MSBuild Item, as follows: %(Filename)%(Extension) So, far the…
José F. Romaniello
  • 13,866
  • 3
  • 36
  • 38
6
votes
4 answers

How do I list all the projects in the current solution using EnvDTE?

I've been following MSDN's Hello World guide to developing Visual Studio extensions (this article specifically deals with creating one as a Visual Studio toolbar command). I am trying to list all projects contained in the current/active solution. In…
Veverke
  • 9,208
  • 4
  • 51
  • 95
6
votes
2 answers

How to get installed VisualStudio extensions programmatically?

How can I get a list of installed VisualStudio extensions? Somehow through DTE? Just the names would be fair enough.
Matthias
  • 15,919
  • 5
  • 39
  • 84
6
votes
2 answers

How can I get only projects from the solution?

I get a list of projects using following: var solution = (IVsSolution)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(IVsSolution)); Refer following link for more details. But it gives me each and every item in the solution like…
Palak.Maheria
  • 1,497
  • 2
  • 15
  • 32
6
votes
1 answer

Retrieving property type from CodeProperty in T4 template

I'm implementing some fairly straight forward code generation using T4, but I'm stuck on a basic problem when it comes to the details of Property generation. When I access the Type property on the CodeProperty objects I want to generate, they are…
eddie.sholl
  • 740
  • 1
  • 6
  • 18
6
votes
1 answer

Visual Studio: Programmatically Create Project Items in project directory

I am trying to create a project item programmatically. i have this code string itemPath = currentSolution.GetProjectItemTemplate("ScreenTemplate.zip", "csproj"); …
Vlatom
  • 71
  • 4
6
votes
2 answers

From a VS2008 VSPackage, how do I get notified whenever caret position changed?

I'd like to get notified whenever the caret position changed in the active text view. The only thing EnvDTE seems to offer is the LineChanged event, which of-course does not get raised when moving the caret left or right within the same line. I…
Omer Raviv
  • 11,409
  • 5
  • 43
  • 82
6
votes
1 answer

How to reconcile the lack of Macros in Visual Studio 2012

My organization has extremely restrictive and rigid rules our code must comply with in order to obtain certification and accreditation. For the last decade or so we have developed nearly a hundred VS macros that format code, generate comments…
5
votes
0 answers

Respond to dialog boxes using DTE.ExecuteCommand

Is there a way to say Yes or No or OK to a dialog/message box while opening Visual Studio 2015 using EnvDTE? I've tried debugging my application while the box is open but I have no idea what to look for. I've also tried searching within this list of…
Syntax Error
  • 1,600
  • 1
  • 26
  • 60
5
votes
1 answer

Form won't save after creating it with EnvDTE

I have created a Visual Studio Add-In that adds a form to an existing Project in the opened solution. This is how I create the form: string templatePath = sol.GetProjectItemTemplate("Form.zip", "csproj"); //sol is an…
Marcelo
  • 3,371
  • 10
  • 45
  • 76
5
votes
1 answer

No reference to project item created through AddFromTemplate() returned

In a Visual Studio Add-In that successfully creates a form, but gives me no reference back to the EnvDTE's prjItem instance. Here's the piece of code that adds the form to the project: string templatePath =…
JohnDoe
  • 63
  • 6