visual-studio-extensions

How to set “Break on All Exceptions”, from a Package

左心房为你撑大大i 提交于 2020-01-10 08:50:36
问题 I want to make an extension to quickly toggle breaking on CLR exceptions in debugger. I have made tried several approaches, neither of which is satisfactory. Here is what I have already tried: ExceptionSettings.SetBreakWhenThrown (MSDN) This is extremely slow (see this Connect issue). I have tried approaches from question "Toggle “Break when an exception is thrown.” using macro or keyboard shortcut" and neither seem to work reliably: in most cases only top level checkbox gets set, and it does

How to open the Visual Studio Editor Programmatically in a VSIX project

纵饮孤独 提交于 2020-01-07 09:15:53
问题 I am working on a VSIX(Visual Studio Extension) project where I am fetching html text from a Service. I need to open the retrieved html text in the Visual Studio Editor. Any idea on how to achieve it or any sample code ? Thanks 回答1: You can save the text to a .html file and then open it in the VS editor with DTE.ItemOperations.OpenFile(file); 回答2: Take a look at AutoFindReplace extension which opens existing files in the editor window. You can download it from the VS Gallery. 来源: https:/

VSIX: Adding Projects with Roslyn refactoring options says “Not supported”

强颜欢笑 提交于 2020-01-04 09:16:08
问题 I feel like there should be an easy way to do this. I mean it can't be possible that you can't add projects via extensions? What I want to do: I want to write a small extension that adds a "code refactoring" option to methods that will generate a test class and method for it in the matching test project. If the test project does not exist, I will create it. Everything is working so far, except that when I try to use Solution.AddProject() it throws the exception System.NotSupportedException :

Developing multiple Visual Studio 2010 extensions

浪尽此生 提交于 2020-01-03 19:42:06
问题 Im working on a couple of independent Visual Studio extensions in separate solutions. When I open one of them and launch the experimental instance in the debugger, the other extensions from the other solutions (which aren't open) are loaded as well. There must be a way to only launch one extension in the experimental instance at a time (in particular the one you're currently working on), right? 回答1: Not really. When you build and run the extension project in VS, it is actually deployed to the

Include whole folder in VSIX

﹥>﹥吖頭↗ 提交于 2020-01-03 06:46:09
问题 Is there an easy way to include a whole folder as content in a VSIX package? Hopefully there is an easier way than setting the "Include in VSIX" flag for each file separately. The reason why we need this, is to add a compiled html help page (with a lot of dependency files) to our extension. 回答1: Is there an easy way to include a whole folder as content in a VSIX package? Hopefully there is an easier way than setting the "Include in VSIX" flag for each file separately. You can use wildcard *

Get identity of logged in Visual Studio user from extension

我们两清 提交于 2020-01-03 04:24:09
问题 I'm developing a visual studio 2015 extension and I'm looking to get the identity of the user who's logged into the IDE (different to the user logged in to windows, or running devenv). I can't figure out where (or if) I can get that information. It doesn't appear to be in the DTE object anywhere and googling around hasn't helped. 回答1: Just the username string username = System.Environment.UserName; or string adName = System.Environment.UserDomainName; Full UserPrinciple System

Convert virtual spaces into real tabs in Visual Studio sdk

我的未来我决定 提交于 2020-01-03 01:25:11
问题 My Visual Studio extension, is arranging Tab Sizes using ITextParagraphPropertiesFactoryService interface. That class is doing a great job, and helps me to set tab widths for all existing lines, but I have a problem to set tab sizes for new virtual line. In other words, Visual Studio is setting caret position in VirtualSnapshotPoint , and converting it to real tabs only when user enters some symbols. Now, Is it possible to force Visual Studio to create real tabs instead of virtual spaces? I

How to get the selected items on Source Control History window when creating a Visual Studio Extension?

戏子无情 提交于 2020-01-02 19:30:22
问题 I develop a Visual Studio extension . I attached a button to the Source Control History Window's Context Menu (the menu with 'changeset details', 'compare', etc.. on it) I need to get the selected History items from the window, but couldn't figure it out how to do it. Update: I'm using team foundation server as source control. Here's the screenshot of the window i want to access to. Screenshot I have found a way to retrieve the window object's data, but i still have some issues: package

How to add C/C++ language service to a Visual Studio-based application?

旧巷老猫 提交于 2020-01-02 13:27:56
问题 I am trying to create a domain specific IDE based on Visual Studio shell. I followed the walk-through to create a basic Isolated Visual Studio Shell Application. Then I started the basic shell application and drag a C file into it. There's no syntax highlighting because no language service is included yet. I found the GUIDs for various Visual Studio feature packages. I was expecting some kind of language feature package for C/C++ listed there so I can just add it into my IDE's feature list.

How to add C/C++ language service to a Visual Studio-based application?

若如初见. 提交于 2020-01-02 13:27:13
问题 I am trying to create a domain specific IDE based on Visual Studio shell. I followed the walk-through to create a basic Isolated Visual Studio Shell Application. Then I started the basic shell application and drag a C file into it. There's no syntax highlighting because no language service is included yet. I found the GUIDs for various Visual Studio feature packages. I was expecting some kind of language feature package for C/C++ listed there so I can just add it into my IDE's feature list.