vs-extensibility

How can I programmatically examine the stack in my Visual Studio extension?

随声附和 提交于 2020-08-11 18:42:13
问题 In a VS extension, assume that the code has just hit a breakpoint, and is in break mode. How can I programmatically examine the stack? Also, is there a way to figure out what the last executed statement was? I haven't been able to find an advanced sample. There are hello-world type samples but they are mostly focused on adding/modifying UI elements in Visual Studio IDE. 回答1: You'll need to hook into the EnvDTE.Events.DebuggerEvents.OnEnterBreakMode event or equivalent to know when the process

How can I programmatically examine the stack in my Visual Studio extension?

為{幸葍}努か 提交于 2020-08-11 18:40:04
问题 In a VS extension, assume that the code has just hit a breakpoint, and is in break mode. How can I programmatically examine the stack? Also, is there a way to figure out what the last executed statement was? I haven't been able to find an advanced sample. There are hello-world type samples but they are mostly focused on adding/modifying UI elements in Visual Studio IDE. 回答1: You'll need to hook into the EnvDTE.Events.DebuggerEvents.OnEnterBreakMode event or equivalent to know when the process

How to close/dispose tool window when visual studio solution closed and create/open toolwindow again in an extension

怎甘沉沦 提交于 2020-08-06 06:09:08
问题 I created a tool window inside visual studio extension using https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-a-tool-window?view=vs-2019. I show some documentation in it based on user inputs from the wizard.Ex : User selected Tab, I show Tab related documentation User closed the solution User created another project , He changed the user input Ex : Bot is selected Expected : Bot documentation to be shown Actual : Tab documentation is shown(Tool window content doesn't change)

Is there a way to add conditions in vsTemplates? or a way to generate output projects based on user selections

纵饮孤独 提交于 2020-05-31 05:42:49
问题 I have a requirement to generate a custom projects template. I am showing the wizard (using vsix project) to the user which has three check boxes in which user can select one or many of them, based on the selection the number of projects need to be created. Suppose user choose one, then output solution must have one project. Suppose user choose any two, then output solution must have those two projects. At Present irrespective of selection three output projects are created. The root

How to add conditions in Visual Studio Template Schema and generate projects based on conditions

痴心易碎 提交于 2020-04-07 09:19:51
问题 I have a requirement to generate a custom project template using vsix and IWizard. Wizard will show three check boxes. for example (Bot, Tab , Chat). The output solution must have projects only for checkboxes selected in the wizard i.e if both Bot and Tab are selected then Bot.csproj and Tab.csproj projects will be generated in the solution. If all three of them are selected then all projects must be generated. Right now it generates all the projects irrespective of the selection because

Is there a good way to stream the results from an external process into a Visual Studio output pane?

与世无争的帅哥 提交于 2020-01-13 11:26:13
问题 I have a custom output pane set up in a VsPackage similar to the following: ///-------------------------------------------------------------------------------- /// <summary>This property gets the custom output pane.</summary> ///-------------------------------------------------------------------------------- private Guid _customPaneGuid = Guid.Empty; private IVsOutputWindowPane _customPane = null; private IVsOutputWindowPane customPane { get { if (_customPane == null) { IVsOutputWindow

Standard controls in VS 2012 extension

跟風遠走 提交于 2020-01-12 07:33:07
问题 I am currently changing a company-internal VS extension to support Visual Studio 2012. What I am struggling with is how to make the UI adapting to the active VS theme dynamically. I found several resource keys for colors/brushes (VsColors/VsBrushes in Microsoft.VisualStudio.Shell.11.0.dll) that I can easily use to change the basic color scheme of the extension. The problem is that the standard controls (text boxes, combo boxes, check boxes) have the default WPF appearance which looks really

Visual Studio Extensibility / Margins

做~自己de王妃 提交于 2020-01-06 04:21:05
问题 I am trying to build a Margin (through MEF) as a VS addin. I need to get the lines that contain the definition of a method. I have found people doing such things but it seems most are parsing test. This seems like a really bad idea as it would obviously only work with languages you knew how to parse. In an addin I can access the document in a programmatic fashion using a higher level model: var fcm = _application.ActiveDocument.ProjectItem.FileCodeModel; var elem = fcm.CodeElementFromPoint

Add context meu item to all files and folders in the solution explorer using vspackage

你。 提交于 2020-01-03 04:34:15
问题 I want to add a menu item to the context menu of all the files and folders in the solution explorer. I was able to add my menu item to the project node with this entry in the vsct file.. <Menu guid="guidERAPackageAlphaCmdSet" id="ERAInsightMenu" priority="0x0700" type="Context"> <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ADD" /> <Strings> <ButtonText>ERA Insight</ButtonText> <CommandName>ERA Insight</CommandName> </Strings> </Menu> I want to get this in the context menu of all

How to register key binding code on VSIX package installation

耗尽温柔 提交于 2020-01-02 07:46:10
问题 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) { dte.Commands.Item("Tools.Something").Bindings = "Global::Ctrl+T, Ctrl+S"; } The problem is, I'd like to invoke this code only once (I don't want to execute this code in package class constructor, because it will execute each time the package will be used first time