Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Is it possible to publish two VSIX packages for the same extension? one targets VS 2022, and the other targets all previous versions
3 replies
just a little question... do the interfaces and the way the extension system is implemented make sense to you? ... I mean... is this really understandable for you? so...really logic? ... I've always a problem understanding the idea behind all this... without examples I'm completely lost
Aleksandr Danchenko

Hey 👋

I'm testing my extension on VS2015, VS2017 and VS2019. On 2019 version all works fine, but for 2015 and 2017 it throw an error

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Не удается найти указанный файл. File name: 'System.Runtime.CompilerServices.Unsafe, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Span1..ctor(T[] array)
at System.Text.Json.JsonSerializer.DeserializeTValue
at System.Text.Json.JsonSerializer.DeserializeTValue
at Common.Json.DeserializeT
at Extension.Service.ApiService.<GetSastSettingsAsync>d5.MoveNext() in C:\Projects\VisualStudio.Extension\ApiService.cs:line 50
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Extension.Service.ApiService.<IsCodeEnabledAsync>d
6.MoveNext() in C:\Projects\VisualStudio\Extension\Service\ApiService.cs:line 69`

I tried to add this in my app.config file

<bindingRedirect oldVersion="" newVersion=""/>

But it doesnt help.

Maybe some one can suggest solution/fix?


Sajal Verma

Is anybody else having trouble with the VsixPublisher.exe tool shipped with VS2022? I am using the windows-2022 image in my Github Actions to publish my extension, but the tool ALWAYS throws an exception from the command line, even though it returns a success message. This happens NO MATTER how to invoke the tool from the command line. For reference, the VS2022 version of this tool is found here: C:\Program Files\Microsoft Visual Studio\2022\Professional\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe.

Unhandled Exception: System.MissingMethodException: Method not found: 'Void Microsoft.VisualStudio.RemoteControl.RemoteControlClient..ctor(Microsoft.VisualStudio.Utilities.Internal.IRegistryTools, System.String, System.String, System.String, Int32, Int32, Int32)'.
at Microsoft.VisualStudio.Telemetry.TelemetryManifestManager.Start(String hostName, Boolean isDisposing)
at Microsoft.VisualStudio.Telemetry.TelemetrySession.Start(Boolean checkPendingAsimovEvents)
at Microsoft.VisualStudio.Sdk.VsixPublisher.TelemetryLogger.CreateTelemetrySession()
at Microsoft.VisualStudio.Sdk.VsixPublisher.TelemetryLogger.get_TelemetrySession()
at Microsoft.VisualStudio.Sdk.VsixPublisher.Program.Main(String[] args)
VSSDK: information VsixPub0041 : Publisher 'SajalVerma' is now logged-in.
Error: Process completed with exit code 1.

If you see the logs, the tool does log me in from the command line, but also throws an exception leading to my publish pipeline failing. If I try logging in from the VS2019-shipped version of it, it works fine.

Trying to invoke the help option also throws this exception from command line, leading me to believe this is a bug: C:\Program Files\Microsoft Visual Studio\2022\Professional\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe --help

Is this community having a Discord? If not, the Discord and this here could be connected with each receiving the messages of the other. Anyone else would be interested? As a full time extension developer, it'd be cool to hangout with other extension devs, helping each others live etc. This gitter is treated like a forum more than a live chat.
You load code into an editor you hide (I guess could be an invisible one), take a VISUAL snapshot then rince/repeat: with the same editor, you load lines of code to 'screenshot' them. In some scenarios, this is smarter than opening a bunch of editors. BUT ...
Did that and it's great but the coloring is partial and doesn't include semantic coloring... so for example, if you have "Console.Writeline(..." the word Console isn't colored as a type.
I guess I would have to wait for all the classifiers/taggers to have their turn on the code before visually capturing, but how? Any idea would be greatly appreciate as I already lost days on this problem....
I tried increasing the priority of the pertinent classifier without avail. I tried implementing my own semantic classifier to get better control. Didn't worked. I tried triggering the classifiers to make them do their job before the screenshoting (i.e. passing through one of my tagger/classifier to mark the code as having changed . event "tagchanged' etc).. also didn't worked.
Kaveesh Dashora
In VS2022, the interfaces IVsSolutionLoadManager and IVsSolutionLoadManagerSupport have been removed. What is the recommended way now to handle solution load?
1 reply
I was using WPF windows in my extension made with VS2017, then used with VS2019.
With VS2022 I am not able to add a WPF window ! if I try to add a WPF user control I have an error on missing reference to Microsoft.VisualStudio.Shell.15.0.
I haven't found anything on adding WPF window or on not adding WPF window.
Someone can help me ?
8 replies
Aleksey Nikolaev
Hello, guyz. Can i ask a question? Is it possible to use DB connection in the VS extension?
Paul Schroeder

I believe so, @leksycode:matrix.org - are you familiar with the IWizard interface? https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-use-wizards-with-project-templates Visual Studio provides the IWizard interface that, when implemented, enables you to run custom code when a user creates a project from a template.

Project template customization can be used to display custom UI that collects user input to customize the template, add additional files to the template, or any other action allowed on a project.

So, @leksycode:matrix.org, my answer above has to do with using a DB connection during installation. If your extension either has the user provide/configure a connection string (through user input), then, yes, your extension can use a database connection during regular operation.
Kunjahamed P
Hi, how to add new menu in solution expolrer > add menu
SolutionFolder.AddGroup.AddMenu is not working
Hello! I'm trying to figure out how you have a task/thread act as a 'background task' in the VS toolbar
I've been going over the docs but haven't figured that one out yet
what do you mean by "VS toolbar" @ameisen ?
at the bottom left of visual studio, there's a 'background tasks' indicator
How do you create your own 'background tasks' that can be put there?
ah. that's easy
one sec
sorry, was pulled away
y9ou want to look at IVsTaskStatusCenterService
Ah, fantastic, thank you
Is this community having a Discord? If not, the Discord and this here could be connected with each receiving the messages of the other. Anyone else would be interested? As a full time extension developer, it'd be cool to hangout with other extension devs, helping each others live etc. This gitter is treated like a forum more than a live chat.
To use Discord as a community would be better.!:)
Anyone interested in a future Discord for this community, reply to this message and we'll write you if it becomes a thing.
3 replies
Added you to the list/thread @Meda97
Mike Hershberg
If I want to listen to document events to populate and update a tool window, is the appropriate place to add the event handlers in the CreateAsync methond of the tool window class or in the constructor for the ToolWindowPane class itself? Where's the appropriate place to remove the event listeners?
2 replies
I tried searching to no avail, so sorry if I didn't find it. Is there an IVsProject ( or perhaps other interface I can get out of an IVsProject ) in which I can query the project to know it is one of the new SDK type project files? Also, if so, is there an interface to query things like EnableDefaultItems or EnableDefaultCompileItems for their respective values? TIA -jclausius
Mike Hershberg
Is there a way to get themed brushes for ToolWindow XAML? I added the toolkit theming (toolkit:Themes.UseVsTheme="True") but I have some ControlTemplate code which needs to specify foreground and background brushes. Does the toolkit provide those?
3 replies
John Dhabolt
@yannduran Long, long ago (back in 2016) you'd responded to someone that was experiencing a "no resource file set the resource merger" error that you'd encountered the same thing. The other person even included a link to the solution he found (like most links from 2016 "eventual inconsistency" holds true and it's no longer available). Do you remember what you'd done to work through the issue? I'm in the process of upgrading a complex extension to VS 2022 (and have shared projects) and just ran into the issue. I'll eventually figure it out but want to avoid this kind of head-banging if possible. :-) Thanks!
NET 5, can it be targeted to create VS2019 extensions? VS2022?
12 replies
Is it known when the new extension model will be the only one available to developers?
Hi I'm writing an extension that adds new item to a C++ project.
I'm calling _dte.ItemOperations.AddNewItem("Visual C++\Header File", "Pippo.h");
But it says the template is not supported for the project.
Do you know what's the exact string to put in?
I read here but it doesn't work :
Mike Hershberg
I tried to create an Extension Pack to make it easier to install some extensions in our private gallery but it isn't working. I specified the vsixId fields in the extension pack to match the <Id> tags in the atom.xml file in our private gallery but no extensions are installed by the pack. What could be wrong?
11 replies
Lambert Clara
Heya! My extension uses the RDT to listen to the OnBeforeSave event. This works great except in one case: when using "Replace in Files" and "Keep modified files open after Replace All" is unticked. Does anyone know if there's another event I can hook onto, or does that sound like a bug? Thanks!
John Dhabolt
I'm in the process of upgrading an extension to support 2022 (and the existing VS 2019). I've modernized, separated all SDK projects into shared projects, and updated the shared metadata as discussed in the documentation. The solution builds and all internal tests run successfully. However, when I test the extension, I get an "Error loading UI library for package {PackageName}. HrLoadNativeUILibrary failed with 0x800a006f" in the VS ActivityLog.xml, but the log indicates there were no problems during the package load (and debugging shows no uncaught exceptions). After VS loads, our extension menu is not present. I haven't bothered adding the VS 2022 projects until I can get the existing VS 2019 to run properly. Has anyone run into a similar problem?

One of my customers reported this VS notification (at the top of document tabs):
"The extension Tabs Studio 5.1.2 will be disabled the next time Visual Studio opens."

There is no explanation from VS. What should we do?

2 replies
@Sergey-Vlasov No indication that it's a performance (e.g. start up) issues?
@Crypties Not in this message. I will ask the customer.
@Sergey-Vlasov Top Menu -> Help -> Visual Studio Performance Manager .. he should find the answers in there
@Crypties Thank you for the tip. This is what was reported.
what's the trick to using images from a SharedProject in a VSIX's WPF windows? I'm trying to follow the guide here (https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/update-visual-studio-extension?view=vs-2022#use-shared-projects-for-multi-targeting) to make an extension target both 2019 and 2022 (I'm currently just attempting to get 2019 working again).
I've tried putting the image files both in the "shared directory" the guide mentions and adding them as a link to the main VSIX project, and I've also tried adding them to the actual .shproj as embedded resources, but whenever the windows load, I just get a System.Windows.Markup.XamlParseException with an InnerException of "IOException: Cannot locate resource 'resources/whatever.ico'"
7 replies