visual-studio-extensions

Get identity of logged in Visual Studio user from extension

╄→гoц情女王★ 提交于 2019-12-07 07:37:39
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. Just the username string username = System.Environment.UserName; or string adName = System.Environment.UserDomainName; Full UserPrinciple System.DirectoryServices.AccountManagement.UserPrincipal.Current Most the normal .net methods for getting users from system or

How to define classification formats for each theme

痴心易碎 提交于 2019-12-07 03:35:54
问题 In my editor extension I use custom classification formats for keywords, identifiers and so on. Of course, there are default formats I could use, because then colors (used by syntax highlighting) will be changed in accordance to the selected theme. Since my custom editor also needs additional classification types (for instance a punctuation type), colors for those types won´t change when the user configures another theme (by switching from Dark to Blue theme, for instance). I would like to

Visual Studio 2017 extension - VSToolsPath not working

我怕爱的太早我们不能终老 提交于 2019-12-06 17:15:43
问题 I'm updating an old Visual Studio extension for VS 2017. It compiles fine from Visual Studio and msbuild in debug and release on my local computer. This is the msbuild command line I am using: msbuild VxCop.sln /p:ToolsHome=C:\ProgramData\chocolatey\bin /p:Configuration=Release /p:Platform="Any CPU" However, on the build machine (TFS Build 2010) calling msbuild.exe with the same command line it fails with this error In order to fix this I am trying to specify VSToolsPath. I've tried various

VSIX extension - Change Path of DLL

痴心易碎 提交于 2019-12-06 16:06:29
I've created a Visual Studio Extension (VSIX) with Visual Studio 2013. In this extension I have a reference to another class library (DLL) which I created. This DLL will be placed in the extension Folder correctly after installing the extension Extension Folder is C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\1oqfh4o4.2y5\ But I need this dll also in the installing directory of the Visual Studio -> C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE If I do not copy the dll into the Visual Studio folder I get an exception that the extension cannot find the

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

感情迁移 提交于 2019-12-06 14:26:53
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.FindToolWindow(typeof(/*I don't know the type of the window*/), 0, false); (package is instance of Microsoft

Visual Studio Extension: Access VS Options from arbitrary DLL

雨燕双飞 提交于 2019-12-06 14:22:46
I'm currently developing my first VS extension, which needs to provide some options to the user. Following https://msdn.microsoft.com/en-us/library/bb166195.aspx , it was rather easy to come up with my own options page. However, I have not yet found out how to read my options. The solution structure of my extension is as follows: MySolution MyProject (generates a DLL from C# code) MyProjectVSIX Following the tutorial cited above, I have added a VS Package to my VSIX project and configured it as described. As a result, my options page with my options is shown under Tools/Options. Nice! Here's

Custom Test Adapter is not showing tests on Test Explorer

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 11:53:29
I am trying to implement a custom Test Adapter, all the files are bellow: TSTestDiscoverer.cs TSTestExecutor.cs TSTestContainer.cs TSTestContainerDiscoverer.cs VsSolutionHelper.cs from XMLTestDiscoverer source code Using vstest.console.exe /listdiscoverers /usevsixextensions:true I confirmed that the extension is installed and it is listed on the test discoverers. Running vstest.console.exe file.ts I confirmed that both TSTestDiscoverer and TSTestExecutor are working correctly. Now I want to list the tests on Test Explorer, for that I guess I need ITestContainer and ITestContainerDiscoverer .

How can an Empty Visual C++ project be created programmatically?

半城伤御伤魂 提交于 2019-12-06 06:42:19
I wanted to know how to use the template for an Empty Visual C++ project to programmatically create a new solution with this empty project. The code (C#) I have right now is: string VSProgID = "VisualStudio.Solution.10.0"; Type solnObjType = System.Type.GetTypeFromProgID(VSProgID, true); Solution4 soln = (Solution4) System.Activator.CreateInstance(solnObjType, true); soln.Create(@"C:\NewSoln", "New"); soln.SaveAs(@"C:\NewSoln\New.sln"); string emptyVCProjPath = soln.GetProjectTemplate("General/Empty Project", "VC++"); // Here's where I need help soln.AddFromTemplate(emptyVCProjPath, @"C:

ElementHost blocks mouse events

守給你的承諾、 提交于 2019-12-06 05:54:39
NOTE: I AM TRYING TO SOLVE THE MOUSE ISSUE, NOT THE KEYBOARD PROBLEM, WHICH IS ALREADY SOLVED So I am creating a Visual Studio 2015 extension, working on the Options pages. I am using WPF, so I use ElementHost to host a UserControl. At first it wasn't receiving keyboard events, so I implemented the solution at: WPF TextBox not accepting Input when in ElementHost in Window Forms A quick run down of the solution: A) on the UserControl's Loaded event, I do: var s = HwndSource.FromVisual(this) as HwndSource; s?.AddHook(ChildHwndSourceHook); B) In ChildHwndSourceHook(), I do something like: static

Visual Studio: How to get IDebugEngine2 from VS Package (except IVsLoader)

房东的猫 提交于 2019-12-06 03:38:06
Is it possible to get a list or a specific instance of IDebugEngine2 ( MSDN ) from a Visual Studio Package without using IVsLoader approach (described here )? Normally I would expect most services to be available through GetService , either directly or through some other service. But I can not easily find anything that can provide debug engines. What are you trying to do with it? The debugger interfaces are extremely fragile. Often there are 2, 3, or maybe more possible ways to perform an action with the debugger interfaces, but the particular DE implementation only supports 1 of them. Debug