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

How do I handle Visual Studio shutdown properly?

I'm trying to handle Visual Studio shutdown in my add-in. The problem is once the shutdown has started various DTE objects methods will no longer work and will instead trigger COMExceptions with E_FAIL error code and so the add-in can no longer work…
sharptooth
  • 167,383
  • 100
  • 513
  • 979
3
votes
3 answers

Visual Studio attach to managed process programmatically

I'm trying to programmatically attach to an IISExpress process for debugging. When using the Visual Studio attach to process window I have to select Managed Code as the type to attach to. If auto detect is selected instead, VS tries to debug…
Max
  • 1,543
  • 2
  • 16
  • 31
3
votes
1 answer

Add template file without custom tool to project programmatically

We add a structure of T4 template files (tt and ttinclude ones) in a project in Visual Studio. For these templates we are using our custom transformation and processing and we do NOT want the Custom Tool setting of the tt files which by default is…
3
votes
2 answers

Fixing configuration/platform in EnvDTE for added project

I have created an add-in that... among other things, adds a c++ project to a solution. I have a problem with adding c++ projects to solutions that contain c# or vb.net projects (I'll refer to these solutions as dot net solutions). I am sure you have…
Thalia
  • 13,637
  • 22
  • 96
  • 190
3
votes
1 answer

DTE: attempt to cast ProjectItem's Window.Document to a TextDocument throws exception

Carlos J. Quintero seems to know a lot about DTE. In an article updated in March of this year and published on the Web (http://www.mztools.com/articles/2007/mz2007027.aspx) he says that the Open method on an EnvDTE. ProjectItem returns an…
albondiga
  • 55
  • 5
3
votes
1 answer

Open DTE solution from another program (not add-in)

Is it possible to modify a solution, and use envdte tools, from a command-line project ? I have an add-in that modifies a solution. But... the changes are required for over a hundred projects... So I'd like to make a c# program that has the same…
Thalia
  • 13,637
  • 22
  • 96
  • 190
3
votes
1 answer

Event fired when caret position changes in Document?

In my visual Studio 2012 extension I am getting the Active EnvDTE.Document using windowEvents = dte2.Events.WindowEvents; windowEvents.WindowActivated += WindowActivated; private void WindowActivated(Window gotfocus, Window lostfocus) { if…
jheppinstall
  • 2,338
  • 4
  • 23
  • 27
3
votes
1 answer

Best practice - How should I persist user input in Visual Studio AddIn?

I am writing a simple VS2012 AddIn and I am not sure where and how I should store data that I need to reuse the next time the AddIn is opened. I was thinking about simply storing the data in an XML file in the same folder as the binary but then I…
Marcus
  • 8,230
  • 11
  • 61
  • 88
3
votes
1 answer

How to overlay a control onto the Visual Studio code surface

I am writing an addin into Sql Server Management Studio, using the Visual Studio Extensibilty APIs. I have had some success overlaying a control onto the text surface (I'm attempting to emulate the CodeRush/Refactor action list, similar to the…
Ben Laan
  • 2,607
  • 3
  • 29
  • 30
3
votes
1 answer

Adding a Property to ENVDTE.Project

I'm trying to work on a Visual Studio Extension that needs to add a property that gets persisted to the current csproj file like so:
Craig Vermeer
  • 1,987
  • 19
  • 29
3
votes
0 answers

Collect attribute property values

I apologize in advance if this gets a little convoluted. I have an attribute class like so: [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] public class RepositoryCollectionMethodAttribute : Attribute { public string MethodName…
Jeremy Holovacs
  • 22,480
  • 33
  • 117
  • 254
3
votes
1 answer

Is there a way to select a project using ENVDTE?

I want to add a Service reference to a project using ENVDTE. The only way is by the following command which pops up the Add service Reference window: _applicationObject.ExecuteCommand("Project.AddServiceReference", string.Empty); But this command…
semantic_c0d3r
  • 819
  • 2
  • 15
  • 31
3
votes
1 answer

Env.DTE usage on Visual Studio 2012 throws sometimes MK_E_UNAVAILABLE

I am using Visual Studio 2012 I have a T4-Template within a project to generate Code from existing Code. For that, i use the Visual Studio Env.DTE-API. The same error as discribed will be thrown in a simple console application, so it cannot be a…
Peter Bucher
  • 295
  • 2
  • 13
3
votes
3 answers

How to register key binding code on VSIX package installation

I'd like to add keyboard shortcut to Visual Studio package only once, during its installation. Basically I know how to do it from the package code, for example: var dte = GetGlobalService(typeof(DTE)) as DTE2; if (dte != null) { …
jwaliszko
  • 16,942
  • 22
  • 92
  • 158
3
votes
1 answer

Visual Studio Add-In: How do I know when a solution has finished loading

I'm writing a VS2008 add-in (using DTE) that needs to be notified after the current solution has finished loading. I've tried using the following code: events = (Events2) applicationObject.Events events.SolutionEvents.Opened +=…
Dror Helper
  • 30,292
  • 15
  • 80
  • 129