vspackage

Visual Studio Call Hierarchy View: call it programmatically

夙愿已清 提交于 2021-02-08 08:46:24
问题 In a VSpackage, is there a way to programmatically call, on a method, the "call hierarchy view" from code and access (even from code) to its results? For completeness: VSpackage target is Visual Studio 2013. Update The final aim is to find how many times a given method (given its namespace and class) is used/called inside the opened solution. 回答1: I'm going to say no. The reason is the "call hierarchy view" isn't going to expose it's data set directly. Instead you'd be better served going

How to be notified when a solution has been loaded for a VSPackage?

空扰寡人 提交于 2021-02-08 05:34:10
问题 I would like to be notified when a solution has been completely loaded. Inspired by this answer I tried implementing IVsSolutionEvents . When I load a solution with two C# projects, wait until loading has finished and finally close Visual Studio 2017, the output shows only the following trace messages: VSTestPackage1: OnAfterOpenProject VSTestPackage1: OnQueryCloseSolution VSTestPackage1: OnQueryCloseProject VSTestPackage1: OnQueryCloseProject VSTestPackage1: OnBeforeCloseSolution

Access current code pane in Visual Studio Extension

穿精又带淫゛_ 提交于 2020-12-29 05:26:26
问题 Im writing a visual studio (2010) extension with a right click menu whilst in a code view. I want to be able to examine the current code from my menu item event handler but havent been able to find somewhere in the object model to do this. How do i access the code in the current window in a visual studio extension? EDIT Heres the code i used to get the current document text DTE dte = Package.GetGlobalService(typeof(DTE)) as DTE ; TextDocument activeDoc = dte.ActiveDocument.Object() as

How to get current solution configuration in vspackage?

旧巷老猫 提交于 2020-01-25 03:37:28
问题 I'm making Visual Studio package, and i need to know opened solution name and configuration. How can i get this information ? Thanks 回答1: If you have a reference to EnvDTE, you can use dte.Solution and dte.Solution.SolutionBuild.ActiveConfiguration . 来源: https://stackoverflow.com/questions/13071175/how-to-get-current-solution-configuration-in-vspackage

How to get current solution configuration in vspackage?

随声附和 提交于 2020-01-25 03:36:33
问题 I'm making Visual Studio package, and i need to know opened solution name and configuration. How can i get this information ? Thanks 回答1: If you have a reference to EnvDTE, you can use dte.Solution and dte.Solution.SolutionBuild.ActiveConfiguration . 来源: https://stackoverflow.com/questions/13071175/how-to-get-current-solution-configuration-in-vspackage

“Exception has been thrown by the target of an invocation.” when building a Visual Studio 2010 VSPackage

柔情痞子 提交于 2020-01-21 07:42:46
问题 I recently create a couple of VSPackages for some Visual Studio extensions (menu bar/command). I compiled them correctly yesterday, checked into TFS (i'm the only one touching this project, FYI). I had already installed these extensions and were working fine. Today it doesn't compile! I get the following error: Exception has been thrown by the target of an invocation. This doesn't tell me anything, so i fired up Visual Studio with the following command: devenv.exe /Rebuild > out.log In my out

“Exception has been thrown by the target of an invocation.” when building a Visual Studio 2010 VSPackage

扶醉桌前 提交于 2020-01-21 07:42:05
问题 I recently create a couple of VSPackages for some Visual Studio extensions (menu bar/command). I compiled them correctly yesterday, checked into TFS (i'm the only one touching this project, FYI). I had already installed these extensions and were working fine. Today it doesn't compile! I get the following error: Exception has been thrown by the target of an invocation. This doesn't tell me anything, so i fired up Visual Studio with the following command: devenv.exe /Rebuild > out.log In my out

How to give Administrator Privileges to my VSPackage?

泄露秘密 提交于 2020-01-17 01:21:29
问题 I've developed a VSPackage for Visual Studio, which needs to copy some files to Visual Studio's Installation Path . If I Run Visual Studio as Administrator (when using my installed VSPackage). It can copy files with no errors. When I run Visual Studio normally, I get Access to the path ... is denied error. Question How can I give my VSPackage to admin privileges even when the Visual Studio is being run as a normal user. Or at least how can I invoke something like this: 回答1: Your package is a

Is there a good way to stream the results from an external process into a Visual Studio output pane?

与世无争的帅哥 提交于 2020-01-13 11:26:13
问题 I have a custom output pane set up in a VsPackage similar to the following: ///-------------------------------------------------------------------------------- /// <summary>This property gets the custom output pane.</summary> ///-------------------------------------------------------------------------------- private Guid _customPaneGuid = Guid.Empty; private IVsOutputWindowPane _customPane = null; private IVsOutputWindowPane customPane { get { if (_customPane == null) { IVsOutputWindow

How to collect types from current solution using Visual Studio Extension?

大憨熊 提交于 2020-01-13 09:56:06
问题 I have created Visual Studio 2012 Package (using VS2012 SDK). This Extension (if installed on the client's IDE environment) should has, among other things, a functionality of collecting all specific types from currently opened solution which developer is working on. A similar feature is embedded in Visual Studio Designer for ASP.NET MVC Application Project, where developer implements a Model/Controller class, build a project, and then is able to access this type in Scaffolding UI (Designer's