visual-studio-extensions

How to implement IDkmCustomVisualizer for managed target

半腔热情 提交于 2019-12-11 15:51:09
问题 So far I was able to run and this sample that implement this interface and using it for debug C++ apps. I try to implement IDkmCustomVisualizer in C#, aiming use it to debug CLR apps. Is this possible ? I retrofitted Hello Wrold sample, where added class that implement IDkmCustomVisualizer and changed HelloWorld.vsdconfigxml. But nothing works, debugger in experimental instance do not use this implementation. Tried with VS 2017 and 2019 Community. my IDkmCustomVisualizer implementation:

hiding a button from a plugin toolbar

我怕爱的太早我们不能终老 提交于 2019-12-11 15:12:48
问题 I am developping a plugin for Visual Studio in C#. The plugin has a settings page and a few buttons in a toolbar to call commands. The problem is that in some circonstances, I want to hide a specific button. The best I was able to do is to disable the button. Is it possible to dynamically change it's visibility? EDIT: I wrote this question from my mobile, so maybe there is not enough details... I create the toolbar in the .vsct file (I created the menu in the same file) <Button guid=

Check for unsaved changes and ask user to save

南楼画角 提交于 2019-12-11 14:58:08
问题 I'm writing an extension which adds files to projects in the solution. It makes sense to check first for unsaved changes and if there are any, ask user to save. How can I achieve this? Are there any open source VS extensions which do this so I can take a look how it's done? 回答1: To find out if there are unsaved changes, you can enumerate open documents with DTE.Documents and check each one for the Document.Saved property. 回答2: You can try to work with project via Microsoft.Build.Evaluation

Visual Studio Extension: How to track when a new method is edited?

Deadly 提交于 2019-12-11 13:10:49
问题 For my Visual Studio Extension, I'm trying to track what methods are selected by the user. To do that, I thought it would be a good idea, to observe the DropDownBar, and track all changes to this bar. So, I started to look for new documents beeing opened, get the IvDropDownBarManager object to get the DropDownBar object: private void OnDocumentOpened(EnvDTE.Document document) { IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell)); IEnumWindowFrames ppenum; uiShell

DGML: how to enable the 'Go To Definition' for custom diagrams?

只谈情不闲聊 提交于 2019-12-11 11:10:03
问题 I am generating a custom workflow diagram via DGML API where each node corresponds to a C# class. I would like to be able to use the built-in 'Go To Definition' feature but the documentation is lacking. 回答1: If you know the class´s filename and the position of the symbol definition, you can use the VsShellUtilities class to open the document and scroll the code artifact into the view (by setting the caret position). In one of my extensions I do something like this... If have a SourceInfo type

Cannot find resource named 'VsTextBoxStyleKey'. Resource names are case sensitive. when debug vsix project

人盡茶涼 提交于 2019-12-11 10:57:41
问题 I'm using vs2019 to create a vsix project, and add a command item after project created, that's all I did. But when I debug the project, I whill get an exception: System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Inner Exception Exception: Cannot find resource named 'VsTextBoxStyleKey'. Resource names are case sensitive. Exception StackTrace: at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader,

Call function of Visual Studio Package

拈花ヽ惹草 提交于 2019-12-11 09:37:29
问题 I have created a new Visual Studio Package that when loaded creates a Tool Window that looks like this: It is comprised of some controls with canvases and such that draw shapes in 2 or 3 dimensions. Right now they work in the initialization step to create the objects you see above. For this tool to be useful I would like to call a method on those controls to pass it other objects to draw. For example, I am debugging some code with points and lines and want to see them graphically. (Perhaps

log4net log file not visible in Windows explorer in application installation sub folder

荒凉一梦 提交于 2019-12-11 08:46:00
问题 I use log4net for my desktop application written in c# and deployed using Visual Studio Extension "Microsoft Visual Studio Installer Projects" (MSI-Installer). After installation I do not see the log subfolder defined for log4net. The TARGETDIR in " Microsoft Visual Studio Installer Projects " is defined as [ProgramFiles64Folder][Manufacturer]\[ProductName] . The log4net log file is defined as <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net"> <param name="File"

Easy VSIX get started?

青春壹個敷衍的年華 提交于 2019-12-11 08:40:11
问题 I've created some macros in VS 2010, I now want to migrate them so they are VSIXs and publish them in the gallery. They are built on top of the DTE object instance provided in the VS macro editor. How to implement this? What is the replacement for the DTE object? Update I also want to configure the extension so that when it's installed on the users machine, it should also install a keyboard shortcut that when pressed, it should run that method in the extension. Note that currently I'm using a

IVsDropdownBarClient and GetEntryText: Problems with text buffers

帅比萌擦擦* 提交于 2019-12-11 08:07:29
问题 In my Visual Studio extension, I'm going to read the text that is in the navigation bar. Therefore I listen to window created events and from the IVsCodeWindow object I get the IVsDropdownBar to get the current selection in the dropdown bar. This works fine. Then I'm using the following code snippet to extract the text of the current selection: string text; barClient.GetEntryText(MembersDropdown, curSelection, out text); if (hr == VSConstants.S_OK) { Debug.WriteLine("Text: " + text); } else {