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
5
votes
0 answers

How can I use EnvDTE within a .NET Standard project

I'm porting a .net 4.7 project to .net standard, which uses T4 to generate some code. I iterate over the classes, properties and methods. This use to work perfectly, but now the return types of DTE are of type 'System.__ComObject' and I cannot cast…
hvk
  • 430
  • 4
  • 11
5
votes
1 answer

Is there an event triggered when dte.Solution.SolutionBuild.StartupProjects changes?

I am building a visual studio 2010 Add-in for internal use in my company. I would like to customize the main window caption to display the name of the current start up project. I can set the caption of the main window with the following code: …
5
votes
0 answers

Accessing Visual Studio DTE members hangs when a modal dialog is opened in the IDE

In the below code, I am trying to access the Debugger property of a valid DTE2 object (obtained through a method similar to this one), to check if it is debugging the current process (multiple Visual Studio instances may be opened). It works well,…
Erwin Mayer
  • 18,076
  • 9
  • 88
  • 126
5
votes
2 answers

Activate Visual Studio's Output window using DTE

I've created a custom output window pane for my VSPackage: Using this code: // Creating Output Window for our package. IVsOutputWindow output = GetService(typeof(SVsOutputWindow)) as IVsOutputWindow; Guid guildGeneral =…
A-Sharabiani
  • 17,750
  • 17
  • 113
  • 128
5
votes
1 answer

Determining if a Mono.Cecil.MethodDefinition is refering to the same function as a given EnvDTE.CodeFunction

Context I've been trying out jbEvain's powerful Mono.Cecil library for just about two weeks now. I've created the following function : /// /// Returns true only if they match. /// private bool…
Kraven
  • 233
  • 2
  • 11
5
votes
0 answers

Installing T4 Template in NuGet Package Creates Compile Errors

I am creating a NuGet Package that has T4 templates within it. Upon installation of my NuGet package, the T4 templates execute immediately, as they are decorated with "TextTemplatingFileGenerator" as the default Custom Tool. There is a perfect…
Mike-E
  • 2,477
  • 3
  • 22
  • 34
5
votes
1 answer

Send the entire debug console output to clipboard?

I would like to know in C# or VB.NET if at any time I could send all the output that is written in the debug console of my IDE, to the clipboard. Example Pseudo-Code in vb.net: For x as integer = 0 to integer.maxvalue debug.writeline("test…
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
5
votes
4 answers

How to programmatically save Visual Studio solution?

I have an application that creates a visual studio solution programmatically and loads project and files that I created in VS2010. I would like to know how to automatically save the solution including project files that is not displaying the dialog…
juan
  • 91
  • 1
  • 5
5
votes
1 answer

Change the Debug properties of Visual Studio project programmatically by EnvDTE

Is it somehow possible to change the project properties in debug section programmatically by EnvDTE classes? I know how to get the DTE instance and work with some of the settings, but I am blind or the debug section is just not accessible. I started…
Lukas Pirkl
  • 1,417
  • 3
  • 15
  • 31
5
votes
1 answer

How can I get IWpfTextView for EnvDte.ActiveDocument?

I am trying to manipulate the Visual Studio Text Editor scrollbar values. The problem is that I have only the dte.ActiveDocument and it is not possible to do it from there. My extension is loaded only once when VS starts and I capture…
mynkow
  • 4,408
  • 4
  • 38
  • 65
5
votes
4 answers

EnvDTE types are not recognized in T4 template

I am trying to get up to speed with T4 templates. I found the following example (here): <#@ template hostspecific="True" #> <#@ output extension="txt" #> <#@ include file="T4Toolbox.tt" #> <#@ import namespace="EnvDTE" #> <# CodeEnum enumeration =…
jkokorian
  • 2,905
  • 7
  • 32
  • 47
4
votes
1 answer

Add Existing File To Visual Studio Project using DTE

I've programatically created a number of files. I want to add them to the visual studio project. I have a reference to the project (DTE.Project). When I execute the code below, I get an error message. project.ProjectItems.AddFromFile(filename); The…
ritcoder
  • 3,274
  • 10
  • 42
  • 62
4
votes
2 answers

How to add files to an SSDT Visual Studio project from Powershell 7

I'd like to automate adding/removing files to/from a SSDT (Database) Project in Powershell 7. My Solution has 3 SSDT Projects in it and is running in a VS 2019 instance. I can get the DTE object with help from # Is there a substitue for…
Brett
  • 719
  • 1
  • 7
  • 19
4
votes
1 answer

Get Access property of a CodeElement

I'm writing an Add-in for VS 2010. Can't find answer for a question - How can i get the Access property of a CodeElement if it has that one. I was trying reflection, but no results. Ex. CodeElement is a class method public void GetAccess…
ibassenezz
  • 53
  • 4
4
votes
0 answers

Get EnvDTE.DTE inside t4 template when TextTransform.exe is run manually

The tt template contains following code: var visualStudio = (this.Host as IServiceProvider) .GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE; Editing tt from Visual Studio triggers code generation. In this case, the visualStudio…
Andrey K.
  • 665
  • 8
  • 29