envdte

DTE.ExecuteCommand and wait

本小妞迷上赌 提交于 2019-12-01 16:19:30
I would like use macros for publishing my webapplication project. The little problem is, DTE.ExecuteCommand run asynchronously, and I need to wait until the command is done. Example: DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate() DTE.ActiveWindow.Object.GetItem("04 - Products\04 - Products.WSS").Select(vsUISelectionType.vsUISelectionTypeSelect) DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Publish") '// now I want copy (and overwrite) some files, but AFTER the publish Is there some synchronization object or information about state of executed command? Hey guys

What is the correct way to subscribe to the EnvDTE80.DTE2.Events2.PublishEvents.OnPublishBegin?

让人想犯罪 __ 提交于 2019-12-01 14:52:05
I'm porting an VS addin to a VS Package. The package subscribes to OnBuildBegin and OnPublishBegin when the package is initialized. Visual Studio triggers OnBuildBegin as expected, but OnPublishBegin is never called. More or less the same code work in Visual Studio 2013, 2012, and 2010 as an addin. But in VS 2015 as a VS Package, OnPublishBegin doesn't appear to be functional. Sample Code is below. To test the code running the debugger configured to start a second instance of VS in Experiment Mode. In the second instance, I open a different solution and publish using the Publish Wizard. using

What is the correct way to subscribe to the EnvDTE80.DTE2.Events2.PublishEvents.OnPublishBegin?

て烟熏妆下的殇ゞ 提交于 2019-12-01 13:52:26
问题 I'm porting an VS addin to a VS Package. The package subscribes to OnBuildBegin and OnPublishBegin when the package is initialized. Visual Studio triggers OnBuildBegin as expected, but OnPublishBegin is never called. More or less the same code work in Visual Studio 2013, 2012, and 2010 as an addin. But in VS 2015 as a VS Package, OnPublishBegin doesn't appear to be functional. Sample Code is below. To test the code running the debugger configured to start a second instance of VS in Experiment

How to get folders under projects?

非 Y 不嫁゛ 提交于 2019-12-01 08:21:41
I am trying to get a list of projects and folders under it. I am able to get the projects and project-items using: DTE2 dte2; dte2=(DTE2)System.Runtime.InteropServices.Marshal. GetActiveObject("VisualStudio.DTE.10.0"); Projects projects = dte2.Solution.Projects; Then, I am iterating through the project items and getting the "kind" of item. But it is showing only GUID. I need to know whether the item is a Folder. How do I do that? Ref: var item = projects.GetEnumerator(); while (item.MoveNext()) { var project = item.Current as Project; for(i=1;i<project.ProjectItems.Count;i++) { string itemType

ENVDTE - Add new project to existing solution and locate it in a specific folder

半世苍凉 提交于 2019-12-01 07:47:17
问题 I wrote a Visual Studio Wizard Template using c# on visual studio 2012. I followed the MSDN steps: I created a VS template, then I created a Class Library project with a class which implements the IWizard interface, I configured the .vstemplate file and etc... In my Class Library project I copy an existing solution from some directory in my computer, I add the new generated project to that solution, and run it. I'm doing this like: public void RunStarted(object automationObject, Dictionary

How to get folders under projects?

被刻印的时光 ゝ 提交于 2019-12-01 07:09:25
问题 I am trying to get a list of projects and folders under it. I am able to get the projects and project-items using: DTE2 dte2; dte2=(DTE2)System.Runtime.InteropServices.Marshal. GetActiveObject("VisualStudio.DTE.10.0"); Projects projects = dte2.Solution.Projects; Then, I am iterating through the project items and getting the "kind" of item. But it is showing only GUID. I need to know whether the item is a Folder. How do I do that? Ref: var item = projects.GetEnumerator(); while (item.MoveNext(

Programmatically reset VisualStudio shortcuts

无人久伴 提交于 2019-12-01 02:46:06
There are two related questions about resetting VisualStudio keyboard scheme and importing VisualStudio settings . However, this doesn't seem to play nice all together. I have two settings files containing shortcuts: <!-- IntelliJ.vssettings --> <ShortcutsScheme>Visual C# 2005</ShortcutsScheme> <UserShortcuts> <Shortcut Command="ReSharper.ReSharper_GotoNextHighlight" Scope="Global">F12</Shortcut> </UserShortcuts> <!-- ReSharper.vssettings --> <ShortcutsScheme>Visual C# 2005</ShortcutsScheme> <UserShortcuts> <!-- Implicitly has F12 assigned to Edit.GoToDefinition --> </UserShortcuts> As you see

EnvDTE not found in VS2012 works in VS2010

半城伤御伤魂 提交于 2019-11-30 23:13:34
问题 I'm using EnvDTE to do some code generation within my T4 Templates. I have the code working correctly in Visual Studio 2010, however I've just started using Visual Studio 2012 and now when I try to run my templates I get the following error Compiling transformation: Metadata file 'EnvDTE.dll' could not be found I don't actually have a reference to EnvDTE in my project as its a Silverlight class library and I wasn't able to add the DLL, however it finds the DLL somehow. I'm not sure what is

Getting EnvDTE.DTE instance outside Visual Studio IDE

南笙酒味 提交于 2019-11-30 21:41:42
I am creating a project automation tool in Visual Studio 2013 where I have my own project template and I am trying to add it to an existing solution programatically.I am using the following code in a console application. EnvDTE.DTE dte = (EnvDTE.DTE)Marshal.GetActiveObject("VisualStudio.DTE.12.0"); string solDir = dte.Solution.FullName; solDir=solDir.Substring(0, solDir.LastIndexOf("\\")); dte.Solution.AddFromTemplate(path, solDir+"\\TestProj", "TestProj", false); It is working when I run the application from Visual Studio IDE. But when I try to run the exe from command prompt, I get the

Programmatically getting the current Visual Studio IDE solution directory from addins

不羁的心 提交于 2019-11-30 06:10:01
I have some tools that perform updates on .NET solutions, but they need to know the directory where the solution is located. I added these tools as External Tools, where they appear in the IDE Tools menu, and supplying $(SolutionDir) as an argument. This works fine. However, I want these tools to be easier to access in the IDE for the user through a custom top level menu (for which I created a Visual Studio integration package project) and through a context menu on solution nodes (for which I created a Visual Studio add-in project). I'm looking for a way to get the current solution directory