vsix

How to programmatically enable visual studio extension

佐手、 提交于 2019-12-24 01:55:20
问题 I have created a visual studio extension and have packaged it in visual studio setup. Now, when i install the setup, the vsix gets installed and is also seen in the Extension manager window, but its in disabled state. I have tried methods like adding registry entry for the extension and etc... but same was not useful. 回答1: You should add ProvideAutoLoad attribute to your package class and specify UI context when it's going to load. For auto-load vsix you should write sthm like this:

Are there any document window focus events?

大兔子大兔子 提交于 2019-12-24 00:38:21
问题 This one has been a bit of a pain due to a similarly named feature in Visual Studio (which I won't mention here for the sake of people searching). What I'd like to do is to listen to events regarding which document window has focus I wish my extension to behave differently depending which SolutionItem is open and has focus. I'd assume there is an event somewhere which will inform me when this focus changes. I've found where I can listen to when a document opens and closes, but not when a

Can't find VSIX dlls with DllImport

て烟熏妆下的殇ゞ 提交于 2019-12-23 10:06:04
问题 I have a VSIX extension which depends on code deployed from an unmanaged DLL. I've included the DLL with the VSIX, and I cracked open the VSIX with a zip program to confirm that it is deployed correctly. However, when I use the DllImport attribute, the .NET Framework claims that it can't find it. How can I import functions from a DLL packaged inside my VSIX? 回答1: I dunno what is going wrong here, but I reinstalled Windows and Visual Studio, made no changes to the project, and now everything

DialogPage - string array not persisted

只谈情不闲聊 提交于 2019-12-23 08:39:58
问题 I'm developing an extension for visual studio. There I have an option page: public class GeneralOptionsPage : DialogPage { [Category("General")] [DisplayName("Foos")] [Description("Bla Foo Bla")] public string[] Foos { get; set; } [Category("General")] [DisplayName("Bar")] [Description("Bar Foo Bar")] public string Bar { get; set; } } The Bar property works perfectly and is persisted. The Foos Property does also work (it even gives you a nice popup in the options page where you can enter one

DialogPage - string array not persisted

匆匆过客 提交于 2019-12-23 08:39:08
问题 I'm developing an extension for visual studio. There I have an option page: public class GeneralOptionsPage : DialogPage { [Category("General")] [DisplayName("Foos")] [Description("Bla Foo Bla")] public string[] Foos { get; set; } [Category("General")] [DisplayName("Bar")] [Description("Bar Foo Bar")] public string Bar { get; set; } } The Bar property works perfectly and is persisted. The Foos Property does also work (it even gives you a nice popup in the options page where you can enter one

How to notify the editor about document changes

和自甴很熟 提交于 2019-12-23 05:25:07
问题 I work on a custom project system and I have an issue with renaming items. The project system implementation is based on MPF and renaming items via the solution explorer worked more or less without any problems, but... When an item gets renamed, I also update information which are stored in the file itself. In case the document is opened by the code editor, the text in the editor doesn´t get refreshed (only the document window´s caption changes to the new filename). If I save the open

how can i add a new icon to a Visual Studio 2010 extension?

夙愿已清 提交于 2019-12-23 01:55:09
问题 i'm developing a Visual Studio 2010 extension, i already have a toolbar inside my window. on that toolbar i have a button that i want to give an icon - my own icon! I've read this article and it is great but... it explains how to replace the icons. i want to add an additional icon. how do i achieve that? 回答1: First, add the bitmap and set its build action to Resource Remember, shocking pink = transparent (damn you, old school!) Then, in your vsct file, add the image to the bitmaps section

Compilation succeeded even though there were some errors from Roslyn Diagnostic Analyzer

走远了吗. 提交于 2019-12-23 00:43:26
问题 The DiagnosticAnalyzer is a custom Roslyn based extension whose DiagnosticDescriptor with DiagnosticSeverity.Error is as shown below internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Description, MessageFormat, Category, DiagnosticSeverity.Error); When the extension is used it does show the red squiggles over the codes that is against the Diagnostic Analyzers custom rule emphasising that it is an error , it is even shown in the Error List window of Visual

How to remove a list of SyntaxNode from the Document using Roslyn code fix provider APIs?

ⅰ亾dé卋堺 提交于 2019-12-22 12:34:12
问题 I'm having a custom generated variable declaration using SyntaxFactory.VariableDeclaration and a list of SyntaxNode 's collected according to some conditions. I did the following: Modify the node var newRoot = root.ReplaceNode(expression, newVariableDeclaration) This successfully modified the node with the newVariableDeclaration . In a loop remove the nodes corresponding to the ones present in the list foreach (var listObject in listObjects) { newRoot = newRoot.RemoveNode(listObject,

VSIX newtonsoft isn't in package (VS>15.5) suppress package

房东的猫 提交于 2019-12-22 08:27:39
问题 We have a solution for vsix projects. Until version 15.4 of visual studio packages were produced with newtonsoft.json.dll, however, since that version, newsoft were excluded from the package. For what I have seen, this is caused because "Microsoft.VsSDK.targets" located in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\VSSDK\Microsoft.VsSDK.targets" has a new exclusion rule "" Our solution needs NewtonSoft, if I install vsix with VS >=15.5