vsix

Unhandled exception in VS extension

非 Y 不嫁゛ 提交于 2021-02-09 11:45:09
问题 I have tried creating a syntax highlighter for a custom file definition. I get an exception when its loaded. I have added the /log parameter to devenv to get a log. 335 ERROR System.Exception: Duplicate EditorFormatDefinition exports with identical NameAttribute metadata exist. Duplicate name attribute is COMMENT Editor or Editor Extension 2010/08/18 06:47:56.726 336 ERROR System.Exception: Duplicate EditorFormatDefinition exports with identical NameAttribute metadata exist. Duplicate name

How to handle Keyboard events in VSIX?

女生的网名这么多〃 提交于 2021-02-08 07:27:40
问题 I am working on VSIX project where I need to detect Enter key OnKeyUp event. How can I implement this in a Text Adornment project? I Need to detect the event when someone press key for changing the line in the editor. 回答1: I got the solution in this thread of mine. We can use KeyProcessor class for keyboard event handling. We can refer from this sample. 来源: https://stackoverflow.com/questions/60261450/how-to-handle-keyboard-events-in-vsix

How to handle Keyboard events in VSIX?

与世无争的帅哥 提交于 2021-02-08 07:26:23
问题 I am working on VSIX project where I need to detect Enter key OnKeyUp event. How can I implement this in a Text Adornment project? I Need to detect the event when someone press key for changing the line in the editor. 回答1: I got the solution in this thread of mine. We can use KeyProcessor class for keyboard event handling. We can refer from this sample. 来源: https://stackoverflow.com/questions/60261450/how-to-handle-keyboard-events-in-vsix

How to handle Keyboard events in VSIX?

左心房为你撑大大i 提交于 2021-02-08 07:26:02
问题 I am working on VSIX project where I need to detect Enter key OnKeyUp event. How can I implement this in a Text Adornment project? I Need to detect the event when someone press key for changing the line in the editor. 回答1: I got the solution in this thread of mine. We can use KeyProcessor class for keyboard event handling. We can refer from this sample. 来源: https://stackoverflow.com/questions/60261450/how-to-handle-keyboard-events-in-vsix

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

Acessing currently opened solution in a vsix project

你离开我真会死。 提交于 2021-02-07 12:54:17
问题 I want to access the path to currently open solution in Visual Studio from a vsix project. How can I get that? This thread tells if a solution is open or not but gives nothing about the path of the opened solution 回答1: I use this: public string GetInitialFolder(DTE dte) { if (!dte.Solution.IsOpen) return null; return System.IO.Path.GetDirectoryName(dte.Solution.FullName); } But expect it to error, sometimes it cannot return a path! 回答2: I would suggest to avoid EnvDTE as much as possible when

How to get project inside of Solution Folder in VSIX project

橙三吉。 提交于 2021-02-07 05:37:27
问题 Hi I am having a problem, with a custom build task inside of a Visual Studio Extension. I need to identify projects of my custom project type. I can do this fine if they are on the root of the solution, but the problem occurs when it is inside of a solution folder. I can get the solution folder as a EnvDTE.Project, but am not sure how to get projects from within that folder. I thought I would be able to get it from the projects Collection property but that is null. Any assistance would be

How to get project inside of Solution Folder in VSIX project

南楼画角 提交于 2021-02-07 05:37:05
问题 Hi I am having a problem, with a custom build task inside of a Visual Studio Extension. I need to identify projects of my custom project type. I can do this fine if they are on the root of the solution, but the problem occurs when it is inside of a solution folder. I can get the solution folder as a EnvDTE.Project, but am not sure how to get projects from within that folder. I thought I would be able to get it from the projects Collection property but that is null. Any assistance would be

How can I enable/disable command in Visual Studio 2017 VSIX C# project

◇◆丶佛笑我妖孽 提交于 2021-01-29 09:00:35
问题 I'm developing an extension for Visual Studio 2017 using a C# VSIX project. I need to create a variable number of commands based on settings in a .ini file. I thought to create a maximum number of commands (because in a VSIX project every command needs a new .cs file), and enable only the commands written in the .ini file. Unfortunately I don't know how to disable a command. I need to enable the commands when a boolean becomes true. I've seen that I need to use the OleMenuCommand class, but I

app.config inside Visual Studio Extension?

房东的猫 提交于 2021-01-28 10:22:30
问题 I have created a Visual Studio extension representing a Visual Studio Project wizard (vsix package). I am attempting to wire up log4net, and this has been unsuccessful. I have chased the issue down to my app.config not being loaded properly. I have added this to my app.config in my visual studio extension: <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="test" value="hello world"/> </appSettings> </configuration> and within my IWizard implementation, I have added