visual-studio-extensions

Installing a Visual Studio Extension

人盡茶涼 提交于 2021-01-28 05:05:06
问题 I've just started using VS2015 and I'm having trouble doing something that should be simple... install the Side Waffle extension. From their website I downloaded the .vsix file, templatepack.vsix. When I double click on it, I get an message, "The extension manifest is invalid." So I went into Visual Studio 2015, went to Tools > Extensions and Updates, and found it under 'Online'. But the only option is to download it. There is no "Install" option. I went back to the download folder, and on

Installing a Visual Studio Extension

折月煮酒 提交于 2021-01-28 05:00:25
问题 I've just started using VS2015 and I'm having trouble doing something that should be simple... install the Side Waffle extension. From their website I downloaded the .vsix file, templatepack.vsix. When I double click on it, I get an message, "The extension manifest is invalid." So I went into Visual Studio 2015, went to Tools > Extensions and Updates, and found it under 'Online'. But the only option is to download it. There is no "Install" option. I went back to the download folder, and on

How to get active IWpfTextView in VS2019 extension (MEF)

安稳与你 提交于 2021-01-07 03:07:27
问题 I'm trying to get the active C# Editor IWpfTextView in VS2019 extension. I'm using a small MEF service to inject a view into the VSAsyncPackage. But it is not very reliable - sometimes the injected view is wrong (e.g. from another view) or missing. Here is the service: public interface IActiveViewAccessor { IWpfTextView? ActiveView { get; } } [Export(typeof(IWpfTextViewConnectionListener))] [Export(typeof(IActiveViewAccessor))] [ContentType("text")] [TextViewRole(PredefinedTextViewRoles

How to get active IWpfTextView in VS2019 extension (MEF)

风流意气都作罢 提交于 2021-01-07 03:04:26
问题 I'm trying to get the active C# Editor IWpfTextView in VS2019 extension. I'm using a small MEF service to inject a view into the VSAsyncPackage. But it is not very reliable - sometimes the injected view is wrong (e.g. from another view) or missing. Here is the service: public interface IActiveViewAccessor { IWpfTextView? ActiveView { get; } } [Export(typeof(IWpfTextViewConnectionListener))] [Export(typeof(IActiveViewAccessor))] [ContentType("text")] [TextViewRole(PredefinedTextViewRoles

Visual Studio 2017 Extension Development

余生颓废 提交于 2021-01-04 06:13:23
问题 Hi I want to upgrade my extension to visual studio 2017 but I got Microsoft.VisualStudio.Shell.RegistrationAttribute error, but I have been already added this reference?I got this error in compile time. Is there any reference to be added or else? Any comment about that? D:\Visual Studio 2017\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Immutable.10.0.dll ,version :10.0.0.0 My Error is Severity Code Description Project File Line Suppression State Error

Visual Studio 2017 Extension Development

无人久伴 提交于 2021-01-04 06:13:19
问题 Hi I want to upgrade my extension to visual studio 2017 but I got Microsoft.VisualStudio.Shell.RegistrationAttribute error, but I have been already added this reference?I got this error in compile time. Is there any reference to be added or else? Any comment about that? D:\Visual Studio 2017\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Immutable.10.0.dll ,version :10.0.0.0 My Error is Severity Code Description Project File Line Suppression State Error

Visual Studio 2017 Extension Development

醉酒当歌 提交于 2021-01-04 06:10:52
问题 Hi I want to upgrade my extension to visual studio 2017 but I got Microsoft.VisualStudio.Shell.RegistrationAttribute error, but I have been already added this reference?I got this error in compile time. Is there any reference to be added or else? Any comment about that? D:\Visual Studio 2017\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Immutable.10.0.dll ,version :10.0.0.0 My Error is Severity Code Description Project File Line Suppression State Error

Visual Studio 2017 Extension Development

自古美人都是妖i 提交于 2021-01-04 06:10:25
问题 Hi I want to upgrade my extension to visual studio 2017 but I got Microsoft.VisualStudio.Shell.RegistrationAttribute error, but I have been already added this reference?I got this error in compile time. Is there any reference to be added or else? Any comment about that? D:\Visual Studio 2017\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Immutable.10.0.dll ,version :10.0.0.0 My Error is Severity Code Description Project File Line Suppression State Error

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

Visual Studio 2015 extension to generate a ToString() method in a class

柔情痞子 提交于 2020-12-16 09:13:43
问题 With extension I meant a Visual Studio Extension. I wan't to know if there's a way to autogenerate a ToString method with an already created extension. I want to have a class with some properties and use a tool to generate the ToString method using its properties. class A { String propA { get; set; } String propB { get; set; } // Autogenerated override ToString() { return "propA = " + propA + ", propB" + propB; } } If not, I wan't to know how can I make one. I searched the web but I can't