dte

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? Thanks in advance. ...

How to put breakpoint in every function of .cpp file?

Is there a macro that does it? Which DTE objects to use? ...

How can I turn DTE.ActiveWindow.Selection into the closest CodeElement in a VS2008 Macro?

I'm working with the Visual Studio 2008 object model as seen here: VS2008 Automation Object Model Chart. I want to act on a CodeElement in a VS2008 Marco, one that is chosen by the user's text selection in the current .cs document. While I don't really care how I get it, this is what I tried: The VS object model gives you DTE.ActiveWin...

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 += DoSomeWorkEvent; Unfortunately it seems that since VS2005 the event is thrown when the solution starts to l...

How to create CodeFunction2 with IEnumerable<> Type?

Hi All, I really need to create something like the following, I am building 2 classes, the first is a class with the name of tableNameAsSingular (i.e AddressEntity) , in my second worker class I need to having something like the following public IEnumerable<AddressEntity> GetAddressEntity() { // the good stuff... } When creating the ...

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 intellisense combo), however I can only locate it's coordinate space based the following proper...

Manipulation of Visual Studio 2008 Solution and Project files

.Net; EnvDTE; Visual Studio 2008; I've written a simple console app. to create a new instance of Visual Studio 2008; followed by opening a solution into this instance (making use of the EnvDTE namespace). In Windows Task Manager devenv.exe loads in the background but the solution task a long time to load. Actually the solution is quite ...

How can I call Edit.FormatDocument on a file from within a T4 template?

I've got a T4 template (also using the T4Toolbox) that scans a folder for files, then processes them and kicks out .cs files. When the processing from the template is done, I want to format them with VS. I've got this far: IServiceProvider hostServiceProvider = (IServiceProvider)Host; EnvDTE.DTE dte = (EnvDTE.DTE)hostServiceProvider.Get...

Can you access 'Service Reference' Programmatically?

Info: C#, Visual Studio 2010 I am trying to access the existing service references and am not sure how, I can achieve the following to get all 'references' DTE2 test = Package.GetGlobalService(typeof(SDTE)) as DTE2; StringBuilder sb = new StringBuilder(); VSProject2 project = test.ActiveDocument.ProjectItem.ContainingProject.Object as ...

How can I find all of the solution's assemblies

I'm writing a Visual Studio extension/add-in and I want to find the names of all of the assemblies created from the projects in the current solution. I don't have any technological limitation - I can use DTE, MEF or whatever else that gets the job done. ...

Catching DTE event in Javascript

I am trying to catch Visual Studio Extension events in browser javascript, DTE is available through window.external: window.external.DTE.Events.SolutionEvents.Opened = ... Access is ok up to "Events", but a SolutionEvents seems not to be found. I've checke the #imported tlb, _Events does have a get_SolutionEvents member. DTE is the c...

Instantiating VisualStudio 2008

I'm trying to get a list of all projects within a specified VS2008 solution. (this is a stand-alone console app, it is not a Visual Studio add-in) My code works with VS2005 solutions, but I get all sorts of ugly COM errors trying to use the VS2008 object. What I mean is: This: Type _visualStudioType = Type.GetTypeFromProgID("VisualStu...

Create new c# project files from code

I'm currently working on an application that will generate actual .cs and .xaml code files and add them to a project. I've managed to do this by manually editing an existing .csproj file and thats working well. However I would like to be able to create the project files from my application as well, to cut out the extra step of creating...

Programmatically add a WCF Service Project Item

Info: C#, Visual Studio 2010 RC How can I add a WCF Web Service Project Item to my Project via code? I can add a Code Class file no problem with: string csItemTemplatePath = soln.GetProjectItemTemplate("CodeFile", "CSharp"); try { projectItems.AddFromTemplate(csItemTemplatePath, fileName); } catch (Exception ex) { // This is ...

Finding a ProjectItem by type name via DTE

Given a type name, is it possible to use DTE to find the ProjectItem that the type is located in? Something similar to how the Navigate To... dialog works in Visual Studio 2010. The closest I could find is Solution.FindProjectItem, but that takes in a file name. Thanks! ...

How to get notification when a successful build has finished?

I'm writing an VS add-in and I need to run a certain method after a successful build. I've tried using dte.Events.BuildEvents.OnBuildDone but that event happens even if the build failed. Is there a property or some other event I should use? ...

How can I listen for the deletion of a ProjectItem via DTE?

I've got a designer that relies on the existence of other solution items. If one of those items is deleted the designer crashes and you have to edit as XML to fix. Not exactly user friendly. I do, however, have the DTE object representing the instance of Visual Studio, as well as the ProjectItems I am dependent on. Is it possible to,...

Encryption on oracle 8i

I need some kind of DTE in oracle 8i? Does oracle8i comes with something built in? Is that even posible? no matter if is a 3rd party solution. Thanks. ...

Getting the return value of a method via DTE.Debugger without evaluating the method?

I'm looking for a way to get the return value of a method via the Visual Studio Debugger (using DTE). Is it possible to obtain it if I'm at the closing brace of the method, but not yet exited? Also, it would be best if this could be possible without evaluating the function again via the immediate window. ...

How to get caret position inside the active webforms designer having only the DTE object in VS2008?

I want to know some information about where the caret is int the currently active webforms designer window, but I have only the DTE object of VS2008. Anything that gets close to this might help, but what I need is: know the EditableDesignerRegion that corresponds to the place where the carret is know the position of the carret in the t...