visual-studio-extensions

How to create command menu item with checkbox?

不羁岁月 提交于 2019-12-12 21:15:51
问题 I'm writing a VSPackage and I need to have menu item with checkbox, just like on this sample image below: I went through this msdn reference regarding .vsct files, bud didn't fine any information explaining how to do it. What I have now is standard menu item with icon and text (code sample from MyPackage.vsct file): <Buttons> <Button guid="guidMyPackageCmdSet" id="cmdidMyPackage" type="Button"> <Icon guid="guidImages" id="myPackageBitmap" /> <CommandFlag>TextChanges</CommandFlag> <CommandFlag

Visual Studio 2013 - JSLint.NET installed but not showing in tools?

懵懂的女人 提交于 2019-12-12 19:40:55
问题 I am new to VS. Went to Extensions and installed JSLint.NET, it is also enabled. But I get no item under Tools to configure or use it? 回答1: JSLint.NET is configured on per project basis. Right click on your project and you should see a menu choice for JSLint.NET Project Settings. You can see an example of this on the Visual Studio gallery page for the extension. JSLint.NET Extension 来源: https://stackoverflow.com/questions/21802536/visual-studio-2013-jslint-net-installed-but-not-showing-in

Visual Studio Extensions - support multiple versions of VS

随声附和 提交于 2019-12-12 14:37:10
问题 I've been writing an extension (Editor Classifier project, with some other features chipped in. It works fine on VS2013, but I need to support other versions VS2012 and VS2015(when it is out of Preview). When I just add supported versions in the vsixmanifest , the problem that I'm facing is, the export of ITestContainerDiscoverer or IClassificationTypeRegistryService fails complaining ContractName="Microsoft.VisualStudio.Text.Classification.IClassificationTypeRegistryService")' is not

How to add custom icons to solution explorer in Visual Studio

依然范特西╮ 提交于 2019-12-12 12:26:49
问题 I am trying to add custom icons to the solution explorer in Visual Studio, the same way the FileIcons extension does. I think I've done everything right for Visual Studio to associate the new icon with files ending with the .d and .di extensions, but Visual Studio still doesn't show any icon in the solution explorer. Here is the manifest generated with ManifestFromResources.exe : <?xml version="1.0" encoding="utf-8"?> <!-- This file was generated by the ManifestFromResources tool.--> <!--

VS Extension: TextPoint.GreaterThan / LessThan very slow for large files

帅比萌擦擦* 提交于 2019-12-12 10:47:49
问题 I'm working on a VS Extension that needs to be aware of which class member the text-cursor is currently located in (methods, properties, etc). It also needs an awareness of the parents (e.g. class, nested classes, etc). It needs to know the type, name, and line number of the member or class. When I say "Type" I mean "method" or "property" not necessarily a ".NET Type". Currently I have it working with this code here: public static class CodeElementHelper { public static CodeElement[]

Visual Studio Extensibility: ProvideAutoLoad for Package.cs for every UI Context

一笑奈何 提交于 2019-12-12 10:37:27
问题 My goal is to create a "Visual Studio Extensibility" which adds a "Npm install" Context Menu Item to a package.json file. So far, this works great if I open a solution, because I've added the [ProvideAutoLoad(Microsoft.VisualStudio.Shell.Interop.UIContextGuids.SolutionExists)] attribute to the Package class. But it's not working if I open a Web Site (File->Open->Web Site...). Do you have any idea, how I can AutoLoad the Package.cs for every UI Context? Edit: More information after further

log4net not working with VS 2015 extension

两盒软妹~` 提交于 2019-12-12 10:22:56
问题 I have a Visual Studio 2015 extension, and would like to use log4net. However, I'm not getting any log messages, and not even internal debugging messages from log4net. In the Package class I have: private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); and later in the Initialize method I have: if (!log4net.LogManager.GetRepository().Configured) { log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo("C:\

How to make a shortcut to run a VSIX method?

心已入冬 提交于 2019-12-12 08:15:57
问题 please see this question. The initial question was solved, and I have a method in my extension. I want that when the user installs the extension, a keyboard-shortcut should be installed as well, and should run the method when pressed. How do I do this? 回答1: You can add shortcuts to the .vsct file. This file is created automatically in the wizard when you generate a new extension and say it will have a menu command. To add it manually: Create MyCommands.vsct Set File Properties to VSCTCompile

How can I match Visual Studio's theme when creating a VSIX tool window?

可紊 提交于 2019-12-12 08:10:27
问题 I am creating an extension for Visual Studio (2012+) that involves a tool window. I was hoping to style the window identically to match the current theme of Visual Studio. However, I am having a great deal of trouble figuring out how to do it. This post suggests that applying no style at all is all that is required, but that does not match my experience thus far (even creating a default VSIX project in VS2017 and adding a tool window shows a button that I would argue is standard WPF in theme

How can I find out when Visual Studio theme color changes?

我只是一个虾纸丫 提交于 2019-12-12 08:06:23
问题 I develop the Visual Studio package with a tool window. The UI of the tool window is based on WPF. In my user control I want to use current Visual Studio theme colors corresponding to the VS design. Therefore my question is how I can find out that Visual Studio theme color has been changed? Thanks in advance. 回答1: I've found another way to do it. I can use visual studio theme colors resources from xaml directly. For example: Background="{DynamicResource {x:Static vsfx:VsBrushes