vs-extensibility

How to change the Caption of the Command on the toolbar from a Macro in VS2010?

核能气质少年 提交于 2019-12-22 00:20:07
问题 From a macro I am accessing a command that is on the toolbar: Dim name As String = "Macros.MyMacros.MyMacros.ToggleExceptions" Dim cmd As EnvDTE.Command = DTE.Commands.Item(name) How do I now change the caption of the command on the toolbar? It does not seem to have the necessary properties. Do I need to cast it to something else? 回答1: I've implemented it: Private Sub Main() Const BAR_NAME As String = "MenuBar" Const CTL_NAME = "Foo" ChangeCommandCaption(BAR_NAME, CTL_NAME, "Bar") End Sub

HWnd of Visual Studio 2010

强颜欢笑 提交于 2019-12-21 12:22:34
问题 Is there a way to get the HWnd pointer to the top window of Visual Studio 2010 from a VSIX extension? (I would like to change the title of the window). 回答1: Since there are good chances that your VSIX extension will be running in-process with Visual Studio, you should try this: System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle (Note if you do this too early, you'll get VS Splash screen ...) 回答2: I'm assuming you want to do this programatically in C#? You'll need to define this P

How to create green (or blue) squiggle adornments with a Visual Studio extension

限于喜欢 提交于 2019-12-21 04:07:03
问题 I have a Visual Studio extension that show red error squiggles. I also like to provide squiggles with other colors, for example yellow for warnings. Creating red squiggles can be done by extending the ITagger class, along the lines: internal sealed class MySquigglesTagger : ITagger<IErrorTag> { public IEnumerable<ITagSpan<IErrorTag>> GetTags(NormalizedSnapshotSpanCollection spans) { foreach (IMappingTagSpan<MyTokenTag> myTokenTag in this._aggregator.GetTags(spans)) SnapshotSpan tagSpan =

How to Get Project Type Guid of selected project in the Solution Explorer by using VS Package

江枫思渺然 提交于 2019-12-19 10:32:38
问题 I've created the simple VS Package for adding new item in the context menu of solution explorer. In that I need to check Selected Project's Project Type GUID. How can i get this. For example, One Solution contains the three different type of projects, like WindowFormsApplication, MVC Projects,WebApplication. While select the MVC Projects, we need to get that ProjectType GUID. I've tried the followings in my Package.cs, IVsMonitorSelection monitorSelection = (IVsMonitorSelection)Package

How to Get Project Type Guid of selected project in the Solution Explorer by using VS Package

雨燕双飞 提交于 2019-12-19 10:32:08
问题 I've created the simple VS Package for adding new item in the context menu of solution explorer. In that I need to check Selected Project's Project Type GUID. How can i get this. For example, One Solution contains the three different type of projects, like WindowFormsApplication, MVC Projects,WebApplication. While select the MVC Projects, we need to get that ProjectType GUID. I've tried the followings in my Package.cs, IVsMonitorSelection monitorSelection = (IVsMonitorSelection)Package

Where is Microsoft.VisualStudio.TeamFoundation.VersionControl.dll in Visual Studio 2015

核能气质少年 提交于 2019-12-18 07:00:57
问题 I'm migrating my own TFS logging extension to VS 2015 and run into many dependency issues. Most of them I was able to get rid off by installing Microsoft.TeamFoundationServer.ExtendedClient nuget package. However there's still one missing reference, the VersionControlExt class versionControlExt = _applicationObject.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt; According to documentation, it is located in Microsoft.VisualStudio

Visual Studio Extensibility (VSX) - Get the current branch name

我的未来我决定 提交于 2019-12-14 02:31:07
问题 I am developing a Visual Studio extension (VS Package). I am trying to get the Source Control branch name for a project/solution. The only source control service available in the VS SDK is SVsSccManager but that doesn't provide any means of retrieving the source control branch name. Also looked at DTE.SourceControl but alas, it doesn't give branch info. I really don't want to develop my own Source Control plug-in to simply retrieve the branch name (this feels like total overkill). Is there

When defining a Visual Studio COM interface in C#, which class / method / parameter attributes should I use?

隐身守侯 提交于 2019-12-13 07:41:05
问题 VS 2017 defines this interface in Microsoft.VisualStudio.Shell.Interop.15.0.DesignTime.dll: [Guid("A459C228-5617-4136-BCBE-C282DF6D9A62")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IVsSolutionEvents7 { void OnAfterCloseFolder(string folderPath); void OnAfterLoadAllDeferredProjects(); void OnAfterOpenFolder(string folderPath); void OnBeforeCloseFolder(string folderPath); void OnQueryCloseFolder(string folderPath, ref int pfCancel); } I want to implement that

Display markers in Visual Studio Solution Explorer

回眸只為那壹抹淺笑 提交于 2019-12-13 02:36:35
问题 I need to display some markers in my Visual Studio extension (As in the image). I have gone through the VS SDK documentation and there are no references in this specific requirement. Is there any way to do this with current SDK? Thanks in advance. https://docs.microsoft.com/en-us/visualstudio/extensibility/visual-studio-sdk 来源: https://stackoverflow.com/questions/47427879/display-markers-in-visual-studio-solution-explorer

Visual Studio 2017 Won't run Custom Tool in .NET Standard Library

独自空忆成欢 提交于 2019-12-12 20:27:16
问题 I'm porting all my development to Visual Studio 2017. I made heavy use of Portable Libraries in 2015, but it appears that .NET Standard is the way to handle cross-environment issues going forward. I've got a single file code generation extension that I've upgraded. In Visual Studio 2017, it works great against the traditional .NET libraries and portable libraries, but it doesn't work with the new .NET Standard library I'm trying to build. I'm happy to consider that I've done something wrong,