visual-studio-extensions

How to programmatically open Visual Studio Tools->Options dialog on a specific page?

北战南征 提交于 2019-12-02 04:17:10
I am writing a Visual Studio extension and I need to programmatically open the Tools->Options dialog on a specific page. I could find how to open the dialog on the default page: var editor = (my_package as System.IServiceProvider).GetService(typeof(DTE)) as DTE2; editor.ExecuteCommand("Tools.Options"); I have found that I can pass some parameter after the command name. But passing the specific page name I want does not seem to do the trick. Is it even possible to open a specific page? Is there some specific grammar to give the expected page name? Is there some better practice to do that

How to open file programmatically using EnvDTE in C#

两盒软妹~` 提交于 2019-12-02 00:12:33
问题 How to open file programmatically using EnvDTE in C#. 回答1: Assuming you have a hook to the correct DTE instance... DTE.ExecuteCommand("File.OpenFile", "c:\\derp.txt"); 回答2: You can try the following snippet directly in the Visual Studio Console: $DTE.ItemOperations.OpenFile("c:\derp.txt",$DTE.Constants.vsViewKindTextView) It should open the file as long as it exists... 来源: https://stackoverflow.com/questions/5039226/how-to-open-file-programmatically-using-envdte-in-c-sharp

How to open file programmatically using EnvDTE in C#

做~自己de王妃 提交于 2019-12-01 22:13:27
How to open file programmatically using EnvDTE in C#. Assuming you have a hook to the correct DTE instance... DTE.ExecuteCommand("File.OpenFile", "c:\\derp.txt"); You can try the following snippet directly in the Visual Studio Console: $DTE.ItemOperations.OpenFile("c:\derp.txt",$DTE.Constants.vsViewKindTextView) It should open the file as long as it exists... 来源: https://stackoverflow.com/questions/5039226/how-to-open-file-programmatically-using-envdte-in-c-sharp

Visual Studio 2017 is not detected by extensions for installation

旧巷老猫 提交于 2019-12-01 16:44:41
I'm trying to install an extension that's only supported on Visual Studio 2017. I'm using Professional, and I never had the RC installed, only the RTM version. VS 2017 isn't detected, however (see install log below). Other extensions install just fine, presumably because they also support VS 2015, which I do have installed. Those extensions do show up in both 2015 and 2017. I tried a repair install, then completely uninstalling and reinstalling, but nothing has fixed the problem. The specific extension is Roslynator 2017 . How can I fix this so VS 2017 is detected and I can install extensions

Visual Studio 2017 is not detected by extensions for installation

删除回忆录丶 提交于 2019-12-01 15:30:49
问题 I'm trying to install an extension that's only supported on Visual Studio 2017. I'm using Professional, and I never had the RC installed, only the RTM version. VS 2017 isn't detected, however (see install log below). Other extensions install just fine, presumably because they also support VS 2015, which I do have installed. Those extensions do show up in both 2015 and 2017. I tried a repair install, then completely uninstalling and reinstalling, but nothing has fixed the problem. The specific

VSIX Project Context Menu

眉间皱痕 提交于 2019-12-01 09:02:25
I'm trying to create a Visual Studio 2017 extension, just for fun and to learn how VS extensibility works. My extension must be usable from the Solution Explorer tab as a context menu button, but I would like to include it at a menu level that isn't root. My goal is to put it in the "Add" sub-menu, but at the moment I'm only able to put it at root level (when you right-click the Project item, the menu entry is shown as the last of the context menu control). How can I move it under the "Add" node? Can it be done from the CommandPlacement tags I have configured in my .vsct file? Use as parent of

Enumerate all files in current visual studio project

£可爱£侵袭症+ 提交于 2019-12-01 08:31:55
问题 I'm trying to write a simple Visual Studio 2012 extension. I have generated the extension template and can bring up a dialog box from a tool menu. I'd like to enumerate all files in the currently open project and then filter them according to some rules. What I'm looking for is a code snippet to return IEnumerable. FileHandle should have the following interface or something similar. interface IFileHandle { // Return the string string Path; // Open the file in the editor void OpenEditorFor();

How get the current running Visual Studio installation path from VSPackage

ぐ巨炮叔叔 提交于 2019-12-01 06:41:47
I've created a VSPackage which should copy some XML schema files to Visual Studio's installation path: %VS install path% \Xml\Schemas . I have multiple Visual Studios installed on my machine: Visual Studio 2013 Professional. Visual Studio 2015 Community Edition. Visual Studio Express Editions. I need to detect the path to the Visual Studio from which my VSPackage is executing its command. How can I get the current running Visual Studio's installation path in the package? First, I agree with Carlos in that particular point that an extension should never require elevated priviledges. But that

What happened to the Visual Studio extension for “Ultra Find”?

不羁的心 提交于 2019-12-01 04:41:23
What happened to the Visual Studio extension for "Ultra Find"? I've seen references all over this site and the Internet for this allegedly awesome extension. Here are a couple of links: http://blog.arainia.com/2010/08/ultra-find-getting-started.html http://coolthingoftheday.blogspot.com/2010/08/i-find-you-ultra-ultra-find-vs2010-add.html And here's a S.O. link: How to exclude designer.cs from Visual Studio file search However, when I search in the VS Extension Manager , nothing shows up. It's as if the extension never existed. I am guessing the author pulled it for some reason, perhaps in

How get the current running Visual Studio installation path from VSPackage

假装没事ソ 提交于 2019-12-01 04:12:45
问题 I've created a VSPackage which should copy some XML schema files to Visual Studio's installation path: %VS install path% \Xml\Schemas . I have multiple Visual Studios installed on my machine: Visual Studio 2013 Professional. Visual Studio 2015 Community Edition. Visual Studio Express Editions. I need to detect the path to the Visual Studio from which my VSPackage is executing its command. How can I get the current running Visual Studio's installation path in the package? 回答1: First, I agree