vsx

Using vsx how do you create a sub menu with commands?

末鹿安然 提交于 2019-12-18 17:02:41
问题 I have created the following vsct file xml. <?xml version="1.0" encoding="utf-8"?> <CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <Extern href="stdidcmd.h"/> <Extern href="vsshlids.h"/> <Extern href="msobtnid.h"/> <Commands package="guidMyVSXCommandsPkg"> <Menus> <Menu guid="guidMyVSXCommandsCmdSet" id="TopLevelMenu" priority="0x100" type="Menu"> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE"/>

How to add context menu entries in website projects?

烂漫一生 提交于 2019-12-18 07:02:35
问题 I'm not able to add context menu entries for website project items. How to reproduce the problem: Create a VS Package project Go to the vsct file and replace the groups section with: <Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0600"> <Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/> </Group> <Group guid="guidVSPackage1CmdSet" id="MyMenuGroup" priority="0x0600"> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE"/> </Group> <Group guid="guidVSPackage1CmdSet" id=

Supporting user-specified file extensions in custom Visual Studio language service

霸气de小男生 提交于 2019-12-18 01:04:36
问题 I'm working on a custom Visual Studio language service, and have several questions regarding the way file extensions are bound to a particular language service. Source files for the language "Example Language" has two primary file extensions: .e1 and .e2 . My extension has a class ExampleLanguagePackage which extends Package. When you use the File → Open command and select a C# file (for example), the "Open" button has a dropdown arrow which allows you to select "Open With...". When you click

“Visual Studio Integration Package” vs “Visual Studio Add-in”: what is the difference?

和自甴很熟 提交于 2019-12-17 23:38:39
问题 When creating a new extension for visual studio, there are two project options: "Visual Studio Integration Package" and "Visual Studio Add-in". What is the difference between the two project types and when would you use one over the other? 回答1: Ok, you can find a full detailed comparison here (there are also links to the previous parts in the series). But basically, add-ins were available as the VS extension type from the very first versions of the VS and built as the COM components. Later on

how to pass/transfer out parameter as reflection? - visual studio extensibility c#

家住魔仙堡 提交于 2019-12-12 09:45:12
问题 I have an out parameter. Is it possible to transfer it as reflection? Can you give me some examples how to do that? 回答1: I'm not sure what this has to do with VS extensibility, but it's certainly possible to invoke a method with an out parameter by reflection and find out the out parameter's value afterwards: using System; using System.Reflection; class Test { static void Main() { MethodInfo method = typeof(int).GetMethod ("TryParse", new Type[] { typeof(string), typeof(int).MakeByRefType() }

Visual Studio Extensions - Calling Options Window and Id for Test Menu

元气小坏坏 提交于 2019-12-11 17:10:26
问题 I'm trying to create a Visual Studio extension but I'm struggling with a few points. When creating a Menu Command, it goes by default to the Tools menu ( id="IDM_VS_MENU_TOOLS"). I want to change it to the Test menu, but I can't find the id for it anywhere. How can I add a call to the Options window? Basically I want to have a Tools > My Menus > Options that goes straight to my items in the Options windows. Any help? Thanks! 回答1: To determine a menu item id, you can use the EnableVSIPLogging

How do you get the default TFS Server from Team Explorer?

半世苍凉 提交于 2019-12-11 07:59:26
问题 A call like this requires the server name or url: TeamFoundationServerFactory.GetServer("mytfsserver"); Likewise, I can use the following to get a list of available servers or server names: TeamFoundationServer[] servers = RegisteredServers.GetServers(); string[] serverNames = RegisteredServers.GetServerNames(); But how do I get the default server that Team Explorer uses to connect? Alternatively, if I could get the current workspace I think I could use that to get the correct

How to access selected project in Solution Explorer from a Visual Studio Add-In?

落爺英雄遲暮 提交于 2019-12-11 06:57:37
问题 I developed a VS 2008 add-in and added a custom menu item to context menu for "Project" nodes in Solution Explorer. This allows me to right-click any project in solution and perform a custom operation on that project. Or at least, it would, if I knew how to access the selected project from my Click event handler . Can someone with more experience please help me? 回答1: I think what you're looking for is DTE.ActiveSolutionProjects. 来源: https://stackoverflow.com/questions/1272022/how-to-access

Invoking standard “File changed outside Visual Studio” dialog

不羁岁月 提交于 2019-12-11 06:48:33
问题 I have succesfuly created custom single view editor in my VSPackage. One of many things I had to cope with was reacting to situation when edited file was changed outside Visual Studio - "standard" editors in Visual Studio display dialog with options like "yes", "yes to all" (reload content) etc., so if more files had changed, only one dialog is displayed. However, the only thing I can do in my VSPackage so far is display custom dialog when the file had changed. It is not pretty - when file

Visual Studio and add-in unloading

你离开我真会死。 提交于 2019-12-11 01:07:44
问题 When I remove an add-in from Visual Studio's add-in menu, it doesn't get unloaded from memory. Does anyone know if I can write some code for my add-in (in C#) that would force this unloading. Is this even possible, or do I have to restart VS? 回答1: If your DLL is written in managed code there is no way to force it to be unloaded as a Visual Studio Add-In. The CLR does not support such a mechanism. The only way to force a DLL to be unloaded from a process is to tear down all AppDomains which