FAQ Database Discussion Community

Install nuget package with a VSPackage

I'm trying to install a nuget package into a project that I am generating with a VSPackage. So far, I am able to create a solution from a project template: Solution4 soln = (Solution4)ApplicationObject.Solution; string prjPath = "C:\\MyProject"; string templatePath = soln.GetProjectTemplate(@"SomeProject\MyTemplate.vstemplate", "CSharp"); soln.AddFromTemplate(templatePath, prjPath, "New CSharp Project", false); But...

How to upgrade a 2013 vspackage to visual Studio 2015

I am trying to upgrade a vspackage to be used for visual studio 2015. The vspackage I created in visual studio 2013 and it works in all prior versions I Updated my dev box with Visual studio 2015. Install the Visual studio 2015 SDK. I upgrade the solution and all...

Obtain a PLK for a 2005/2008 VSPackage

Our VS extension still needs to support VS 2005 and 2008, but I cannot generate a VSPackage PLK anymore - the system seems to be either broken or no longer supported by Microsoft. There is an MSDN page: How to: Obtain a PLK for a VSPackage, but steps described there...

Get the path of the active document in Visual Studio

I am writing a VSPackage for Visual Studio 2013 using C#. I need a simple menu to be added to the Visual Studio menu bar. When clicking it, I want the current open (active) document in Visual Studio to be uploaded on a specific repository. More Explanation: I want to...

Read and change project properties “Start external program” and “command line arguments”

I'm trying to read (and change) the project properties "Start external program" and "Command line arguments" of a VisualStudio 2013 project within a VSPackage. The code I wrote so far looks like: var dte = GetService(typeof(DTE)) as DTE2; if (dte == null) return; var sb = (SolutionBuild2)dte.Solution.SolutionBuild; var projectNames...

Why I get the problems with Visual Studio “2013” SDK samples?

Visual Studio 2013 Premium Update 4; Visual Studio 2013 SDK installed. I see the code sources are for older Visual Stuido version. It has a link to Visual Studio 2010 (instead of 2013) SDK Samples.zip file. I try compile its some projects but I get an exceptions... For example: Other...

How can I obtain the list of files in a project from VSIX(/MPF) code?

I am building a VSIX package to support a custom language in Visual Studio using MPF. I am in a custom designer and I need to find the files referenced in the project to resolve some dependencies. Where can I access this list?

Change menu item string for VSPackage

I have a C# VSPackage project. It's a tool that helps with some stuff here in our office. It operates via a Tools menu item. I thought of a better name for the menu item, but how do I change it in the code? Every instance I've tried changing doesn't...

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

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.

File Watcher in VSPackage

I'm new in developing in Visual Studio so I hope my problem is not too stupid :-) I try to establish a FileWatcher in my VSPackage to detect any changes performed in the current solution. For this I found the class FileWatcher, which - in my opinion - detect any...

Modifying project properties of custom project system in VisualStudio

I have tried to create a custom project system by walk through https://msdn.microsoft.com/en-us/library/vstudio/cc512961.aspx and succeeded. And now I want to modify the project properties of this created project system. The second part of this walk through is guiding to create property pages for solution properties. (Solution Explorer-> Right Click on...