Visual Studio Keyboard Shortcuts disappear

Ian Lochray 0 Reputation points
2024-01-16T23:46:44.7533333+00:00

I have a custom VS extension which adds commands to the Tools menu. It's running in VS 2022 with C++ solutions. I use the Tools->Options menu to add shortcuts to some of these custom commands. I save and exit VS and then start it up again witheth same solution. All is as expected - the shortcuts are still present. I exit VS and open a second solution. Again, all is good. Finally, I open a second instance of VS in parallel with either of the two presvious solutions. Now the shortcuts have disappeared from BOTH instances of VS. I can see that the ApplicationPrivateSettings.xml is being updated. When the error happens, the ".A" entry for the command is removed but the ".R" entry is present.

Can anyone explain this behaviour? I suspect that the custom extension is wiping the shortcut but I can't explain why it only happens when there is a second VS instance open.

Finally, in C# (the extension is written in C#), how can I read the existing shortcuts that are configured?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,821 questions
Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
189 questions
{count} votes