visual-studio-package

MsBuild with Visual Studio 2012 Package Project

天涯浪子 提交于 2019-12-13 01:25:26
问题 I have created .NET solution with Visual Studio 2012 Package Project (From VS2012 SDK ). With Visual Studio I successfully compile and run this project (along with entire solution) in " Debug " configuration mode, and for " Any CPU " platform. But when I try to build solution in command line using MsBuild , I get errors: Command: msbuild MySolution.sln /p:Configuration=Debug /p:Platform="Any CPU" Errors: error : Can not find the installation for VS SDK. error MSB4018: The

calling Roslyn from VSIX command

老子叫甜甜 提交于 2019-12-07 02:32:08
问题 What is best way to obtain Roslyn's SyntaxTree from EnvDTE.ProjectItem? I found some method for the other way (Roslyn's Document into ProjectItem). I got VSIX command called from opened document and I'd like to experiment with Roslyn's syntax tree there. This code works, but looks awkward to me: var pi = GetProjectItem(); var piName = pi.get_FileNames(1); var componentModel = (IComponentModel)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SComponentModel)); var workspace =

What is the correct way to subscribe to the EnvDTE80.DTE2.Events2.PublishEvents.OnPublishBegin?

让人想犯罪 __ 提交于 2019-12-01 14:52:05
I'm porting an VS addin to a VS Package. The package subscribes to OnBuildBegin and OnPublishBegin when the package is initialized. Visual Studio triggers OnBuildBegin as expected, but OnPublishBegin is never called. More or less the same code work in Visual Studio 2013, 2012, and 2010 as an addin. But in VS 2015 as a VS Package, OnPublishBegin doesn't appear to be functional. Sample Code is below. To test the code running the debugger configured to start a second instance of VS in Experiment Mode. In the second instance, I open a different solution and publish using the Publish Wizard. using

What is the correct way to subscribe to the EnvDTE80.DTE2.Events2.PublishEvents.OnPublishBegin?

て烟熏妆下的殇ゞ 提交于 2019-12-01 13:52:26
问题 I'm porting an VS addin to a VS Package. The package subscribes to OnBuildBegin and OnPublishBegin when the package is initialized. Visual Studio triggers OnBuildBegin as expected, but OnPublishBegin is never called. More or less the same code work in Visual Studio 2013, 2012, and 2010 as an addin. But in VS 2015 as a VS Package, OnPublishBegin doesn't appear to be functional. Sample Code is below. To test the code running the debugger configured to start a second instance of VS in Experiment

How to acquire DTE object instance in a VS package project?

依然范特西╮ 提交于 2019-11-28 06:32:35
问题 How can I get DTE instance in a VS package project? It's straigtforward in addin project since application is being passed as an argument to onConnection method, but it is unclear how to get it in a package. 回答1: From your main Package class: EnvDTE80.DTE2 dte = this.GetService(typeof(Microsoft.VisualStudio.Shell.Interop.SDTE)) as EnvDTE80.DTE2; 回答2: You can get a null instance getting the SDTE service if the shell is not fully initialized. See how to handle that in this code sample: HOWTO: