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
3
votes
1 answer

Get type information from assemblies in current solution from VS2010 extension

I'm building a command extension for the UML Sequence Diagram in VS2010, and need a list of types that implement a particular interface in the current solution. How do you access type and assembly information from an extension? So far all of my…
shader
  • 801
  • 1
  • 7
  • 25
3
votes
1 answer

How to obatin a different interface from a COM object in PowerShell

Using COM methods like [System.Runtime.InteropServices.Marshal]::GetActiveObject("VisualStudio.DTE") I can navigate the Visual Studio DTE object model fine. For instance from DTE object I can get Debugger, and then LocalProcesses, and the the…
Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
3
votes
0 answers

How to get changed code lines in Visual Studio 2019 programmatically?

I want to make an extension for Visual Studio 2019 where I can go through changed code lines (the lines which are marked as green/yellow) by clicking a button - a similar function like the "navigate Back/forward" button, but only for changed code…
user11909
  • 1,235
  • 11
  • 27
3
votes
2 answers

How do I Edit a .cs file in a Add-In Project using DTE

I'm trying to write my first add-in for vs2010, but im struggling. I have a assembly that generates lots of cs files. I want my plugin to add new files to the select project or if the files exist, overwrite them. I'm having 2 problems: When I add a…
STEVEN PARRY
  • 61
  • 1
  • 4
3
votes
1 answer

Getting the macro value of project's TargetPath via DTE

I need to get the absolute output path of the project's assembly via DTE. I tried doing this using this method, where I would access the OutputPath property, combining it with the assembly name, however this produces the relative path, such…
Igal Tabachnik
  • 31,174
  • 15
  • 92
  • 157
3
votes
3 answers

How can I create new blank solution in vs 2008 programmatically?

The design based approach is: New Project -> Other Project Type -> Visual Studio Solution -> Blank Solution I have to create a blank solution programmatically in C# and in this solution add new empty project and files. i found a lot of code on the…
user591790
  • 545
  • 2
  • 15
  • 33
3
votes
0 answers

Why get references to both DTE and DTE2?

I'm getting started with Visual Studio automation and wrapping my head around its object model. In the Visual Studio automation MSDN docs describing the relationship between EnvDTE.DTE and EnvDTE80.DTE2, there is the following advice: However, the…
Hydrargyrum
  • 3,378
  • 4
  • 27
  • 41
3
votes
1 answer

How can I change the text of an EnvDTE.Document?

I assign new json text to a document using the following code: public virtual async Task SetDocumentText(FileInfo fileInfo, string contents) { if (fileInfo == null) throw new ArgumentNullException(nameof(fileInfo)); …
3
votes
2 answers

ExtensionManager null in Visual Studio 2017

In previous versions of Visual Studio I could use the following code to retrieve information about a certain installed extension (vsix): IVsExtensionManager manager = ServiceProvider.GlobalProvider.GetService(typeof(SVsExtensionManager)) as…
Odrai
  • 2,163
  • 2
  • 31
  • 62
3
votes
1 answer

EnvDTE - Get the Find text results from 'FindResult 1" window in Visual Studio with C#

According to this post, you can make Visual Studio find. I update the code of Asif Iqbal K from the article a bit to eliminate build error. public const string vsWindowKindFindResults1 = "{0F887920-C2B6-11D2-9375-0080C747D9A0}"; public string…
123iamking
  • 2,387
  • 4
  • 36
  • 56
3
votes
2 answers

Programmatically add an entry to the "External tools" menu of Visual Studio 2017

Does anybody know if it is possible to to add an entry to the "External Tools" menu of Visual Studio 2017 with EnvDTE or any other method? The only thing I found so far is to add some registry entries which doesn't seem to work for VS2017.
luni64
  • 321
  • 2
  • 8
3
votes
1 answer

Can't access FileCodeModel from Powershell console in Visual Studio 2017 DTE

I'm trying to automate some code-related routines in VisualStudio 2017 using integrated Powershell console and VS Automation model (DTE). When I'm working on Solution/Project/File level, things are ok, e.g. PS>…
Stan
  • 1,931
  • 16
  • 17
3
votes
1 answer

Problem using EnvDTE.Property.set_Value to set ProjectItem FullPath Property

I have a Visual Studio Project Wizard that attempts to configure a VC# project to override the FullPath property for selected files from the template. The following code is used from within function public void ProjectFinishedGenerating(Project…
user517041
  • 41
  • 4
3
votes
3 answers

VSIX window - key shortcut to execute ICommand

Having a Visual Studio extension (VSIX) project: In Window we got UserControl, which have Button binded to some ICommand. This works perfectly as expected, however I would like to attach a key shortcut (e.g.:CTRL + S) which would fire the same…
Tatranskymedved
  • 4,194
  • 3
  • 21
  • 47
3
votes
1 answer

How can I get the Error Code from Error List in VS 2015/2017 with DTE? Or other ways can get error code?

I want to extend the Error List in Visual studio 2015/2017,I only use the DTE can get the ErrorItem however the ErrorItem don'e contain the ErrorCode just like below, how can i get the error code? Thanks in advance!
D.Andy
  • 247
  • 3
  • 9