Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
AraHaan
@AraHaan
Anyone know how to find the color value in my theme for the WMDocumentGroupContainerControl on the background of it when no documents are loaded when the IDE first opens? I been needing to change it in my VSTheme project (among other things that needs fixed in my theme).
meirumeiru
@meirumeiru
can I add own items to the "ResourceView" ? ... I know, the ResourceView is a "tool window" and that I could create my own tool window... but, is it also possible to add a node under the project-node (like the .rc node of C++ resources)?? and if yes, how?
3 replies
meirumeiru
@meirumeiru
does someone know how this works with the items of the "Hierarchy"? ... where do they come from? who's generating them? and how are they implemented?... could I create an object and add it into this hierarchy? ... I'm trying to find out how this works for days now, but... I don't understand it... maybe because I'm overlooking the parts talking about it
2 replies
Christopher Christou
@awschristou
My extension (MyVsix.csproj) contains plugin-style dlls (MyPluginA.csproj/MyPluginB.csproj) in the vsix. These plugin dlls do not reference the Visual Studio SDK. My extension does not directly use any types from the plugin dlls (it uses reflection or MEF to discover and instantiate). Is there a way to have Visual Studio auto-load these plugin-style dlls as part of the extension initialization without explicitly making Assembly.Load calls?
Julien
@juli1
Hi folks, I am looking to hire a developer to develop a Visual Studio extension. What place do you recommend for posting the job and/or attract Visual Studio developers?
1 reply
jonmiller1
@jonmiller1
I want to create a custom project type. I came across some documentation that says I should the VSPS (Visual Studio Project System Extensibility). When I go to the github site for it, it hasn't been updated since VS2017. Is this project dead? What should I do for VS 2022? https://github.com/microsoft/VSProjectSystem
1 reply
hefaistos68
@hefaistos68:matrix.org
[m]

Hello, I have added the Community.VisualStudio.Toolkit to my VSIX project to get the theme styles right, but after adding the nuget package (for vs2022) and inserting the tags as shown in the sample code,

<UserControl x:Class="mine.GeneralOptionsControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dw="clr-namespace:mine"
             xmlns:toolkit="clr-namespace:Community.VisualStudio.Toolkit;assembly=Community.VisualStudio.Toolkit"
             toolkit:Themes.UseVsTheme="True"

I get XAML errors: error MC3072: The property 'Themes.UseVsTheme' does not exist in XML namespace 'clr-namespace:Community.VisualStudio.Toolkit;assembly=Community.VisualStudio.Toolkit'.

any ideas what I am doing wrong?

1 reply
Aleksandr
@aldanchenko
Hello 👋. Could someone share how to get path to solution? I can get solution path in normal case, but if *sln file placed in not root folder of solution I get only path of this sln file. As an example
Screenshot 2022-04-09 at 13.19.14.png
martin-honnen
@martin-honnen
vs2022XMLDocumentPropertyStylesheet.png
Does anyone know how, from a VS 2022 extension, to read out properties like "Schemas" or "Stylesheet" the XML editor adds to XML files? They show us in the property list when a tab with an XML document is active and the VS user can select a schema there or even a stylesheet (although I think the stylesheet field is there in the community edition of VS without having any attached functionality, only the commercial editions use to offer XSLT execution or debugging). Anyway, for an extension I would like to be able to read out those properties but I haven't been able to find an obvious way how to do that. Any suggestions appreciated.
1 reply
nbkalex
@nbkalex
Hello everyone! Is there any event/property/function/xaml resource to get the zoom level of the text/code editor?
7 replies
Michel Kaporin
@michelkaporin

Hi folks! I am setting up extension publishing pipeline to Marketplace using VsixPublisher. When I run it, I get the following error:

VSSDK: error VsixPub0029 : An error occurred while communicating with the marketplace: vsixId: The VSIX ID in the provided file is already in use. Every extension needs to have an unique ID. Provide a file with an unique ID.

I have published extension previously via Marketplace but it seems it tries to publish as a new, instead of updating the old one. I am publishing using the same extension ID as well as bumped up version. Do you know what could be the problem? Thank you!

1 reply
mmkuklinski
@mmkuklinski
Is there an API that one can use to load/store properties/values directly in the solution file itself rather than in an SUO?
AraHaan
@AraHaan
Has anyone here ever created a project type extension that has only a single feature (build)? I am trying to make an extension that provides support for a special type of project that can only be built and can not be debugged. Basically has only 2 targets ("Build" and "Rebuild").
Martin Eriksson
@meriksson1991
Hello! I am new to visual studio extensions and have an idea of extending the visual studio debugger but am having a hard time finding any samples for this kind of extension. Can someone here point me in the right direction? Would be highly appreciated.
Fabio GS
@onolox_twitter
Hi people, in an c# editor, there's a way to get the object class of an item under the cursor? With CodeElement I can get the function, but the itens inside I don't. If I put the cursor over an people.getName(), how do I get the full class name of it?
5 replies
jonmiller1
@jonmiller1
I'm new to VS extensions. I want to write a custom project system. The examples out there seem very old an outdated. Is there anyone that can help me out? I would pay $ for some advice and guidance.
2 replies
Sateesh Kumar Vinjamuri
@vsateeshk_twitter
My VS Extension have custom Menu New Items in Solution Explore->Right Click -> Menu node Items.
But when I build extension code in Visual Studio 2022 build then Menu new custom item nodes are not showing in my VS Extenstion
Any idea, what code changes I have to look in (.vsixmanifest) files
2 replies
Scott Haney
@ScottHaney
When a special file type is double clicked in solution explorer I want to open not that file but a filepath within that file. I overrode IVsRunningDocTableEvents4.OnBeforeFirstDocumentLock to try to do this but no matter what I do in that method (or any other method) I can't seem to stop the file that was double clicked from opening. When I try the DTE events they say something about not being able to close a file from an event handler. How do you stop a file from opening and instead open another file? Right now I call .Hide() on the opened file and that works as a hack.
1 reply
Jonatan Gefen
@jgefen
Hi, I have created an IAsyncCompletionUniversalSource for xml file, but when I use it I get 2 completion list opened - one of the internal xml editor and mine. How can I merge the 2 lists into one completion list?
image.png
Antonín Procházka
@prochan2
Hi, which extension point would be the best (or at least would work) to execute code before any build starts? (Or will bock the first build before this code is executed.) I need to pass an msbuild property to a build of a legacy (not SDK-style) C#/VB project.
1 reply
Matt Whitfield
@mattwhitfield
Hello all. For the 'New Project Dialog' it lists the .net versions (netcoreapp and newer) along with a description like 'Long term support'/'out of support'. Could anyone tell me how to get that list from the VS SDK? I tried with IVsFrameworkMultiTargeting but that seems to list netFx versions only...
JohanKustner
@JohanKustner
Hi all.
Hi all. I recently updated my extension https://marketplace.visualstudio.com/items?itemName=JohanKustner.Dynamics365StrongTypeEntityClassGenerator but have noticed that whilst it is available in the Visual Studio Marketplace, it no longer appears within "Manage Extensions" in Visual Studio. I also added a new version of it to work with Visual Studio 2022 at https://marketplace.visualstudio.com/items?itemName=JohanKustner.DataverseClassGeneratorVS2022 but am experiencing the same problem with this VSIX. Any ideas?
8 replies
Uniwares
@hefaistos68:matrix.org
[m]
Or whatever your specific target is
Silly question: did you mark 2022 on the "manage" page for your extension on the market place?
1 reply
Steve Trautman
@SteveTrautmanPEI
I'm wanting to create a new extension in VS 2022 that is a customer editor (fairly involved, grid display the data file, with properties, a custom menu, and a tool window). The docs I can find so far led me to a c++ template which got me basic custom editor, great. But the doc starts off saying that there is no longer a c# template available. My question is, how do I add a custom menu in c++? All the docs/examples for that functionality are in c#. I can't find any docs/apis/examples of adding a new custom menu with c++.
manuelxmarquez
@manuelxmarquez

@SteveTrautmanPEI Not sure about C++ but you can use IVsEditorFactory and WindowPane to host a WPF control. I have a prototype of it but can't share that particular project. Maybe search GitHub for an example.

I saw this yesterday and it's a great API to make life simpler and has an example of a menu, or just create the sample project template.
https://docs.microsoft.com/en-us/visualstudio/extensibility/vsix/get-started/first-extension?view=vs-2022

https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.interop.ivseditorfactory?view=visualstudiosdk-2022
https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.windowpane?view=visualstudiosdk-2022

Matt Whitfield
@mattwhitfield
@SteveTrautmanPEI There's an example of a custom editor in my extension - https://github.com/mattwhitfield/Unitverse - look in the src/Unitverse/Views folder 👍
Matt Whitfield
@mattwhitfield
Actually, sorry - src/Unitverse/Editor - the hosted control is in the Views/ folder
Erik Ejlskov Jensen
@ErikEJ
mmkuklinski
@mmkuklinski
With a Package that is marked as PackageAutoLoadFlags.BackgroundLoad, is there a way to give it priority? I don't mind it loading asynchronously, but I'd rather it gets triggered/loaded before Intellisense starts processing for 10 minutes.
Kaveesh Dashora
@kaveeshd
This message was deleted
ShettyRGanesh
@ShettyRGanesh
Screenshot (41).png
1 reply
Robert van der Hulst
@RobertvanderHulst

Hello! I am new to visual studio extensions and have an idea of extending the visual studio debugger but am having a hard time finding any samples for this kind of extension. Can someone here point me in the right direction? Would be highly appreciated.

https://github.com/microsoft/ConcordExtensibilitySamples

LeChat
@Krusty84
Hello Dear All, does anybody have the samples/snippets what explain how interact command on the toolbar with tool window? Thanks!
mmkuklinski
@mmkuklinski
Since the 2022 VSSDK renamed Microsoft.VisualStudio.Shell.Task to Microsoft.VisualStudio.Shell.TaskListItem, is there a way to take advantage of that in a plugin that also must target 2019?
Cat
@cshroedinger
Is it possible to get events regarding document windows gaining/losing focus?
I have a handler for WindowEvents.WindowActiveted, but it seems to only messages w/r/t to the VS main window.
I also have a handler for ShellEventListener.OnBroadcastMessage, but doesn't seem to get events w/r/t Document windows in VS 2022.
What am I missing?
SpencerIsaacson
@SpencerIsaacson
So a plugin I'm maintaining is no longer working, and I'm kind of confused as to why. The menu items and commands simply no longer show up in the menu, and when I set a breakpoint on InitializeAsync for the extension package, it seems that it's simply not getting called
1 reply
mmkuklinski
@mmkuklinski
Ramon Viladomat
@Viladoman
Does anybody know if any of the last updates on VS2022 broke the IViewTaggerProvider. They don't get created and even the example on the documentation does not work anymore: https://docs.microsoft.com/en-us/visualstudio/extensibility/walkthrough-highlighting-text?view=vs-2022 ( it used to work on the first VS 2022 preview and older VS versions ). Of course it might be a bad setup on my end, If someone has a working example on a simple text highlight on latest VS2022 I would really appreciate it.
1 reply
wangrd
@wangrd
How can i extend the Git changes page in vs2022? We can get it from ITeamExplorer- > GitChanges in vs2019-,but it not work in vs2022.
1 reply
Mike Hershberg
@mhershberg
Hello. I'm a bit stumped. In my extension I have an event handler for "OnAfterOpenProject" but when I try to find the project by name using VS.Solutions.FindProjectAsync it returns null. Shouldn't the project be opened when OnAfterOpenProject executes? Here is a code snippet:
public int OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded)
{
    ThreadHelper.ThrowIfNotOnUIThread();

    if (pHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_Name, out object propValue) == VSConstants.S_OK)
    {
        string name = propValue as string;
        if (name != null && string.Equals(name, TARGET_PROJECT_NAME))
        {
            Project project = await VS.Solutions.FindProjectsAsync(name);
            // PROJECT IS NULL!!!!!
        }
    }

    return VSConstants.S_OK;
}
4 replies
Marimuthu
@maroldo26
Hi All,
I'm trying to port a extension built for VS 2010 to VS 2022. What are the things I can reuse from the old version. Is there are any article/document which explains how to port the old VS extensions to newer versions of Visual studio ?
1 reply
Asaf Agami
@asaf92

Hi All,
I'm trying to write an integration test for a VSIX extension with the VsixTesting package, but I'm failing to simply load a solution or open the IDE without code. I'm stuck on the initial screen that shows recently opened projects.
I tried both IVsSolution2.OpenSolutionFile and DTE2.Solution.Open. In both cases it looks like something might be spinning in the background but I still see the initial welcome window and the IDE doesn't open.

How do you load a solution in a VS extension test?

modenamo
@modenamo
Hey! Does anybody know what is the correct way to provide automation objects from VSIX package, so they can be used in third-party applications with DTE COM interface?
I've added [ProvideAutomationObject("CustomObject")] to my interface and I'm able to get it from another side, but I'm unable to cast it to desire type. I've added [Guid] and [ComVisible(true)] attributes on interface and class, but still no effect.
Maybe the should be some configuration in VSIX or solution settings?
Mike Hershberg
@mhershberg
I'm having trouble debugging a menu command extension written using the Community Toolkit. If I set breakpoints anywhere they are disabled with the message "No symbols have been loaded for this document." Even executing the menu command itself still results in no breakpoints working. Is there something I can do to fix this?
6 replies
Mike Hershberg
@mhershberg
When I try to inspect a Community.VisualStudio.Toolkit.Project type variable the Visual Studio 2019 debugger says "<Internal Error Evaluating Expression>". Is this a known issue with the Community Toolkit or is something weird going on with my Visual Studio?
2 replies