vspackage

Attach VsPackage to Roslyn Instance

两盒软妹~` 提交于 2019-12-10 18:09:30
问题 I'm trying to create a VsPackage that makes use of the Roslyn Language Services. Under the properties of my VsPackage, I've changed the command line arguments to: /rootsuffix Roslyn When running the project, the instance of Visual Studio that starts up is correctly using Roslyn. (I see [Roslyn] next to the names of .cs files I have open). However, my VsPackage is not deployed to this instance of Visual Studio. I have opened up the SyntaxVisualizerExtension VsPackage that ships with Roslyn and

DTEEvents.OnStartupComplete event not working for VSPackage (VSSDK2010)

北慕城南 提交于 2019-12-10 11:12:01
问题 In the Package constructor I added the event handler for OnStartupComplete event. But when I run the code, the the event handler is not called. What am I doing wrong? 回答1: There's a bug in VS that recycles the DTEEvents object (with your event handlers) unless you keep an explicit reference to it. You need something like this: [ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string)] [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string)] class MyPackage : Package { DTEEvents

Visual Studio Extension: Access VS Options from arbitrary DLL

喜夏-厌秋 提交于 2019-12-10 10:46:19
问题 I'm currently developing my first VS extension, which needs to provide some options to the user. Following https://msdn.microsoft.com/en-us/library/bb166195.aspx, it was rather easy to come up with my own options page. However, I have not yet found out how to read my options. The solution structure of my extension is as follows: MySolution MyProject (generates a DLL from C# code) MyProjectVSIX Following the tutorial cited above, I have added a VS Package to my VSIX project and configured it

Why isn't my vspackage's context menu showing

 ̄綄美尐妖づ 提交于 2019-12-10 02:02:15
问题 I already have a package that I created, and I'd like to add a menu to the Code Window context menu. After a little search I found several articles explaining how to do it. The problem is, I can't get it work.... Here are my declarations in the vsct file: <Button guid="guidDALGeneratorPkgCmdSet" id="cmdidDataFlow" priority="0x0100" type="Button"> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN"/> <CommandFlag>DynamicVisibility</CommandFlag> <Strings> <CommandName>cmdidDataFlow<

Getting the dte2 or TeamFoundationServerExt object in a VS Package project?

我的未来我决定 提交于 2019-12-09 18:45:59
问题 I am working on a Visual Studio Package project. This project needs a connection to our TFS. To read the current connection, I would need the TeamFoundationServerExt object, which I should be able to get from the dte2 object. Now I found hundreds of examples and most of them are working with an "_application" variable, which seems to get automatically filled, but of course not for the "Visual Studio Package" project type. How can I get the TeamFoundationServerExt object of the currently

Suppress “No Source Available” pane in 2010

怎甘沉沦 提交于 2019-12-09 09:42:10
问题 Arg! I have a custom "harness" executable running my class library project. Every time I step into the harness's code, I get that "No Source Available" pane popping up. As I know there is no source available, and that this is completely expected, I don't want this very intrusive and useless pane popping up every time. How can I suppress it completely? I can make it smaller at least by making that window part of another smaller pane-set, such as with the watches/locals. It remembers its

How to use IVsFontAndColorEvents?

无人久伴 提交于 2019-12-08 06:17:02
问题 Microsoft's own site does not explain in details how to use this interface. They claim that this is the way to get notified if the Fonts & Colors change in Visual Studio. I tried what seemed to be an obvious choice and implemented the interface on my package, but there were no attributes mentioned I should set on my VSPackage. Unfortunately that doesn't seem to be enough. Here's a sample of what I did: public class SceVSIPackage : Package, IVsFontAndColorEvents { public int OnApply() { return

HowTo get all interfaces types from visual studio solution?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 18:08:49
问题 I'm trying to write an extension to visual studio. I need to get a list of all the interfaces types found in all the projects in the current opened solution . So far i have tried doing this using the EnvDev namespace. Is there a way of doing this without parsing the project's .cs files ? Thanks, Chai. 来源: https://stackoverflow.com/questions/13051397/howto-get-all-interfaces-types-from-visual-studio-solution

Visual Studio Extension: Access VS Options from arbitrary DLL

雨燕双飞 提交于 2019-12-06 14:22:46
I'm currently developing my first VS extension, which needs to provide some options to the user. Following https://msdn.microsoft.com/en-us/library/bb166195.aspx , it was rather easy to come up with my own options page. However, I have not yet found out how to read my options. The solution structure of my extension is as follows: MySolution MyProject (generates a DLL from C# code) MyProjectVSIX Following the tutorial cited above, I have added a VS Package to my VSIX project and configured it as described. As a result, my options page with my options is shown under Tools/Options. Nice! Here's

DTEEvents.OnStartupComplete event not working for VSPackage (VSSDK2010)

拟墨画扇 提交于 2019-12-06 12:00:41
In the Package constructor I added the event handler for OnStartupComplete event. But when I run the code, the the event handler is not called. What am I doing wrong? There's a bug in VS that recycles the DTEEvents object (with your event handlers) unless you keep an explicit reference to it. You need something like this: [ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string)] [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string)] class MyPackage : Package { DTEEvents _EventsObj; protected override void Initialize() { var dte = (EnvDTE.DTE)GetService(typeof(EnvDTE.DTE)); _EventsObj