Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
I use StructureTag to get guide line and outline. I got the guide line but there is not outline. How do I get the outline for the structure?
This is the tag code in tagger GetTags method.
StructureTag tag;

tag = new StructureTag(snapshot, outliningSpan, headerSpan, null, null, PredefinedStructureTagTypes.Member, true);

yield return new TagSpanStructureTag(structureSpan, tag);
what would cause VisualStudioWorkspace.OpenDocument to not work? It doesn't throw any exceptions or anything, it just simply doesn't open the document...
I've also tried DTE2.OpenFile with the full path to the file (which is a member of a project, which is a member of the opened solution) and that also does nothing.
cool, VsShellUtilities.OpenDocument also does absolutely nothing. what gives?
I've tried force-saving the solution and all projects before calling OpenDocument, I've tried adding an await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync() directly beforehand (even though I'm already on the UI thread), I've even tried looping 10 times with a 1-second delay between tries to see if it's some timing thing, and absolutely nothing happens. the workspace just sits there with no document open. I can copy the exact file path it's trying to open and use Ctrl+O to open it manually, and it opens the file as a member of the current solution (not a "miscellaneous file" or whatever), so it's definitely in the solution as a compilation unit. that shouldn't matter; I'd expect it to open any document you give it. It's just totally unresponsive.
Indu Prakash
2 replies
Any idea how one can adjust the "No issues found" message at t he left-bottom of the document.
Vyacheslav Avdeev
@ArcanoxDragon I guess you can start from a new, empty, vsix and try to open something. if it successed, then copy stuff from your vsix to the new and check if opening works... and so on. no other ideas...
Jakub Míšek

Hello; does anybody know if there's currently some issue with icons in Project Hierarchy on VS 2022 Preview 3,4,5?

We're providing ImageManifest with both xaml and png (16x16) icons; they load and show well in project and item templates. However since DEV17 preview 3 they are not showing (just a blank space is displayed instead) in the project hierarchy (both in CPS extended with IProjectTreePropertiesProvider, and in old MPF where we provide IconMoniker through VSHPROPID_IconMoniker** properties)

Thank you for any hints.


Anyone knows how to make projection buffers to work in VS 2022?

I reported this problem on Developer Community in August, but no answer so far:

1 reply
Aleksandr Danchenko
Hello, maybe someone know if it possible to handle unhandled exceptions in VS extension? I tried this approach:
Dispatcher.CurrentDispatcher.UnhandledException += this.App_DispatcherUnhandledException;
But no success.
7 replies
Michael Sawczyn

So I've started looking at updating my extension, which is based on the Modeling SDK, to support VS2022. I've read the guidance on updating generic VSIX packages, but in the back of my mind I think of Modeling SDK projects as "special", they being such a nicely architected and tight framework.

Is there any guidance available (or coming up soon) to direct how to update these kinds of projects? Users are starting to ask more and more, and I'm feeling quite small not being able to give them an answer other than "yeah, I know ... I'm working on it".

Hi. In VS 2019, how to make structure guide line tooltip uses existing classification result from an existing classification tagger that tagged the snapshot that has the text the tooltip displays?
Dose anyone know how to add a source code file to the solution use VS extensions sdk?
6 replies
Does Visual Studio not run dotnet template post actions? In my case, it works fine from dotnet CLI but Visual Studio displays the manualInstructions text instead. Does that mean it will never do it or just that I've got a particular configuration that it doesn't like.
1 reply
Alexander Gayko
@ErikEJ hey, regarding having a single extension project for VS2019+2022, you're using the VS.SDK package v16 - is that necessary? i.e. how does it provide the required dlls for VS2017, in your case?
--> VS2019 complains about not getting Microsoft.VisualStudio.Shell.15.0, Version 17.0 - since that's not available there. is there an automagic fallback or will i need to dial the vssdk down maximally?
I want to "draw" in the Solution Explorer tree view. Do anybody know how to or known of sample code that can do the same as Solution Error Visualizer (https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.SolutionErrorVisualizer)?
Steve Baker
Hi will the marketplace support multiple VSIX's per extension listing when 2022 releases? Or do we have a date for that?
John Dhabolt
Does anyone know if the NuGet window in Visual Studio can be extended, such as adding a button or data entry field and having access to the libraries being looked up?
3 replies
Steve Baker
Is there any way to change the name/location of source.extension.vsixmanifest?
Antonín Procházka
Hi, this one is somwhere between this room and dotnet/roslyn, so I'd ask here too: Why are all the Microsoft.CodeAnalysis* NuGet packages of version 4.0.0 unlisted at NuGet.org and why there's no 4.0.0 version of Microsoft.VisualStudio.LanguageServices yet? Are these waiting for .NET Conf? It's confusing because VS 2022 is out already.
@prochan2 please ask over at github.com/dotnet/roslyn.
Antonín Procházka
It's released now.
Antonín Procházka
Now I see that the package Microsoft.VisualStudio.ProjectSystem.SDK is still in preview.
When using Community.VisualStudio.Toolkit to create my extension, I can easily get the solution path using solutions.getcurrentsolutionasync() & solution.FullPath, yet if the user would open a directory instead of an .sln in visual studio is there a way to get the base directory of what is opened?
7 replies
Hi, I'm trying to install Microsoft.VisualStudio.SDK to a project. It tries to install Microsoft.ServiceHub.Analyzers but fails: Could not install package 'Microsoft.ServiceHub.Analyzers 3.0.3078'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework.
Any idea? It does not help if the project target e.g. .net framework 4.7.2. It's a new (empty) .net framework class library project. The same error happens when I try to install only the Microsoft.ServiceHub.Analyzers nuget. The package description does not list any .net framework dependencies at all.
If instead of normal class library project I create new VSIX project I can install the Microsoft.VisualStudio.SDK. Does it work only with VSIX project types?
4 replies
Robert van der Hulst
We are trying to add packagereference support to our custom project system that is based on MPF. When we implement VsProject4 on our automation objects then the nuget system detects that we want to support this and starts asking the question whether we we want to use packages.config or packagereference. When we choose packagereference then the nuget dialog complains about SourceProject not being correct.
Does anybody know, have documentation or an example that shows what other steps we have to take? We have already spent quite some time in this and it is very frustrating that we can’t find examples or documentation.
Locating the packagereference nodes in the project file and displaying them in the solution explorer is working. The only thing missing is how to complete the link with the nuget reference dialog.

Does anyone have any advice on how to debug this problem? I have an extension written for a VS Isolated shell v15 that works correctly on one PC - it is a set of MEF classes for the editor and one command. On a second PC with the same version of Iso shell app, the extension loads (I can see and use the command on the menu) but none of the MEF classes are loaded ever and I can't find any evidence in the activity log of it even attempting to load them.

So, any ideas what I could try to figure out why the MEF components are being ignored only on this one installation?

2 replies
@jgefen Thanks for the help - all sorted now - that log didn't have anything about my extension in it, but it pointed me to the right place and I found there was a duplicate install of the extension under that set of folders.
Michael Brogdon

Hey yall, I'm trying to update my VSIX to work with 2022 and I'm hitting issues with some of the APIs.

I am using a EnvDTE.TextPoint to look at the CodeElement to identify which type of code element I'm on, but it always comes back null.

I tried looking through API changes and didn't see anything that seems to relate.

Would anyone here have an idea?

Mike Hershberg
I can't view the values of SolutionItem or ProjectItem variables in the VS2019 debugger. They simply show "<Internal Error evaluating expression>". Is this normal or is there an issue with my set up? (using Community library)
error CS1579: foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public instance or extension definition for 'GetEnumerator'

I'm getting this error when trying to update my extension to VS2022

public VCFile FindFile(VCProject project, string name)
            foreach (VCFile file in project.Files)

The code works fine with previous versions, not clear to me why these dynamic properties are not working here

I'm referencing the latest SDK and ProjectSystem packages
    <PackageReference Include="Microsoft.VisualStudio.Sdk" Version="17.0.31902.203" />
    <PackageReference Include="Microsoft.VisualStudio.ProjectSystem" Version="17.0.1313-pre" />
Mike Hershberg
I'm using the Community Toolkit to create a command. My command needs to use the ITextSearchService but if I add a property with the [Import] attribute the property is always null. Why doesn't this work?
internal sealed class MyCommand : BaseCommand<MyCommand>
    internal ITextSearchService TextSearchService { get; set; }
5 replies
Vyacheslav Egorov
Hello there, I'm updating my custom debugger extension for VS 2022 and tool tips that I return from GetQuickInfoItemAsync are no longer displayed.It seems like they are now being overriden by debugger data tips, but even in cases when debugger can't display its own data tip, my QuickInfoItem is still not visible.
Did the API around GetQuickInfoItemAsync change in the new version?
Vyacheslav Egorov
I'm developing a debugger extension for a language that is not natively supported (Lua) and I quite like that VS 2022 now calls 'IDkmLanguageExpressionEvaluator.EvaluateExpression' with the word under the cursor, but sadly VS doesn't know about other language rules and if you hover the 'prop' in an expression like 'obj.prop', EvaluateExpression is called with "prop" and not "obj.prop". My custom GetQuickInfoItemAsync handler was used to handle this.
Venkat A
How to get output dll path
i am using Community.VisualStudio.Toolkit
Ben Medina-Orton
I'm trying to write an extension that runs an external tool when a readonly file is attempted to be edited. I don't really know where to start. Would I be able to achieve this somehow via the IWpfTextView instance for each document?
The overall flow I want to enable is:
1 - User opens readonly file in Visual Studio.
2 - They attempt to make an edit to the file.
3 - My extension detects this and runs an external tool to make the file editable.
4 - The user's edit from step 2 is applied.
Thanks in advance for any help!
2 replies
Mike Hershberg
Hello. Really stuck without the TextSearchService. Still haven't figured out why I can't [Import] it in my Community Toolkit-based project. Any help is appreciated.
Hello. I started developing a project type with CPS WindowsScript sample. I use Visual Studio 2022. A new project can be created from the project template and is loaded. But my export class in the package that applies to the capability is not called. Why?
Hey, Description: Method not found: &apos;System.String EnvDTE._DTE.get_Version()&apos;.&#x000D;&#x000A;System.MissingMethodException any idea about this error, trying to upgrade my extension to vs 2022
found the issue, I have two VSIX projects in the same solution, one for VS 2022 and another one for previous versions, here the old VSIX was deployed to the exp hive..., things started working again once Ice clean the exp hive and deploy the correct VSIX.
Hi does anyone know where SSMS 18.10 keeps track of extensions to load -mine is trying to load something that doesn't exist and so I can't open a new editor window and I am having no luck finding out how to remove the bad entry. I know the name of the pkgdef it is trying (And failing) to load.
1 reply

Hey, I have a custom project page registered with

    internal class ProjectDesignerPageProvider : IVsProjectDesignerPageProvider
        public Task<IReadOnlyCollection<IPageMetadata>> GetPagesAsync() =>
            Task.FromResult((IReadOnlyCollection<IPageMetadata>)ImmutableArray.Create(new SliceCompilePageMetadata()));

But GetPageAsync is not called by Visual Studio 2022, did anything changes on how these property pages work? so far the same works fine with 2017 and 2019, and I cannot figure why this doesn't work with vs 2022

Jan Bartholomäus-Jung
Hey guys. Is it possible to update content of toolwindow from within package class? are there any resources for things like that?
hi all... I created my own debugging extension for our webserver (this works) but I try to start Chrome at the same time and attach the JavaScript debugger to it. I need to fill the IDebugLaunchSettings for it and... I've no idea how to do it. What's the value for LaunchDebugEngineGuid to set? I tried {74c8030c-83da-48ab-63ff-d814e06202f8} and {8c52fb37-f184-4444-abba-fc22bf7d4106} (I got them from the private registry hive of VS 2017) but it cannot start because of an "invalid pointer" (a popup says that)... can someone tell me how to do this? Or how to find all the possible debugger engines registered in the system?