vspackage

How to add additional tool windows to a Visual Studio Extension?

半世苍凉 提交于 2019-12-01 01:17:37
When creating an Extension for Visual Studio 2013 a tool window gets set up by default. However, I'd like to have a second tool window and can't see how one is supposed to go about that. I have created a guide: HOWTO: Create a toolwindow with a ToolWindowPane class in a Visual Studio package http://www.visualstudioextensibility.com/2015/02/20/mz-tools-articles-series-howto-create-a-toolwindow-with-a-toolwindowpane-class-in-a-visual-studio-package/ Well I just found a few things - so I'm gonna answer my own question so that other people having the same problem may take advantage of it: Set up

How do I programmatically refresh/reload a VS project after modifying the underlying file?

浪子不回头ぞ 提交于 2019-11-30 21:43:28
I am developing a Visual Studio package and I have written some code that will make a file in Solution Explorer dependant upon another file. What this means is that it gives them the same relationship as code-behind files or designer files, where they appear nested under the parent file with a plus/minus icon. + MainForm.cs - MainForm.cs MainForm.Designer.cs MainForm.resx The code that I have written successfully and correctly modifies the underlying project file, however the change is not reflected in Solution Explorer until the project is closed and re-opened. I'm looking for some code that

How to get the details of the selected item in solution explorer using vs package

感情迁移 提交于 2019-11-30 15:16:31
I am trying to create a VS package in which, i have added a menu command to the context menu you get when you right click an item in solution explorer. Now on clicking the command i want to show a pop up with the details of the item on which you right clicked and choose my command. How can i get it done?? what service i can use to get the details of the selected item? private static EnvDTE80.DTE2 GetDTE2() { return GetGlobalService(typeof(DTE)) as EnvDTE80.DTE2; } private string GetSourceFilePath() { EnvDTE80.DTE2 _applicationObject = GetDTE2(); UIHierarchy uih = _applicationObject.ToolWindows

VSIX Package doesn't include referenced project's dependencies

徘徊边缘 提交于 2019-11-30 14:47:23
We have a visual studio package (VS Package) that references a class library project (Project A). Project A in turn references another class library project (Project B). So the dependency structure looks like this: VS Package > Project A > Project B All projects exist inside the same solution and the dependencies have been set up as proper project references. If I build the package in visual studio and look in the bin/Debug folder all necessary assemblies are there including Project B's. However when the package is deployed, only Project A's assemblies are present and Project B's are missing.

Detect the Visual Studio version inside a VSPackage

笑着哭i 提交于 2019-11-30 13:53:21
问题 How can I check/detect which Visual Studio version is running under my VSPackage? I cannot get from the registry because the computer could have several versions installed, so I guess there is an API that is able to get it. Anybody knows how to get it from a managed Visual Studio package using C#? 回答1: You could try to get version via automation DTE object . In MPF you could get it in this way: EnvDTE.DTE dte = (EnvDTE.DTE)Package.GetGlobalService(typeof(EnvDTE.DTE)); There are some other

Detect the Visual Studio version inside a VSPackage

感情迁移 提交于 2019-11-30 08:52:51
How can I check/detect which Visual Studio version is running under my VSPackage? I cannot get from the registry because the computer could have several versions installed, so I guess there is an API that is able to get it. Anybody knows how to get it from a managed Visual Studio package using C#? You could try to get version via automation DTE object . In MPF you could get it in this way: EnvDTE.DTE dte = (EnvDTE.DTE)Package.GetGlobalService(typeof(EnvDTE.DTE)); There are some other related things to retrieve DTE object - via Project.DTE , also read this thread if you're getting null for DTE.

How to get the details of the selected item in solution explorer using vs package

怎甘沉沦 提交于 2019-11-29 21:00:39
问题 I am trying to create a VS package in which, I have added a menu command to the context menu, so it appears when you right click an item in the solution explorer. Now on clicking the command, I want to show a pop up with the details of the item, on which you right clicked and invoked the command. Now how would I get information about the selected item? Is there any service I can use in order to get any details about the item? 回答1: private static EnvDTE80.DTE2 GetDTE2() { return

Append item to Add menu of solution- or project node in Solution Explorer

牧云@^-^@ 提交于 2019-11-29 05:17:56
How can I add a sub menu for the Add menu item when right click on a visual studio solution explorer? I have to add a single sub menu item which will be displayed n right clicking the visual studio solution and move to the Add option in that menu. I am trying using .vsct (vs package). Please help me with valuable suggestions Matze Of course, there are similiar questions, but this seems to be a special case... In general, you need to know the menu´s command- and package id that you want to extend. I usually do this by enabling the EnableVSIPLogging option in the registry as described by this

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

做~自己de王妃 提交于 2019-11-28 21:07:20
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? 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, some limitations were discovered in that approach, so the new extensibility feature was created -- namely

How to get reference to 'Roslyn' Workspace object from IVsSolution?

萝らか妹 提交于 2019-11-28 11:39:18
I have a VS Package project from which I need to access Roslyn or Microsoft.CodeAnalysis' Workspace OR Solution object from the loaded IVsSolution . I need to know how I could achieve that ? I found this stackoverflow discussion here which suggests to use PrimaryWorkspace static property of Workspace class which I can't find in Microsoft.CodeAnalysis.Workspace EDIT: I found out that Microsoft.CodeAnalysis does not have this yet but I downloaded the older release of Roslyn from Nuget.org which has this. But now PrimaryWorkspace Property is giving me NULL :( I am using Isolated Shell. Kevin