How to add command to right click context menu for solution explorer in VS 2022 extension
I am trying to create .vsix extension , i want to create command which shows up when i right click .razor file, but i wasn't able to find the correct id for parent to do this, can someone help me please?
29 Replies
adding stuff to the registry
this is what 7zip does when you install it
i don't think i understand what do you mean
i wan to add item to file right click menu
something like this
my problem is that i can not find the correct id
Oh, you want to do it inside your VS extension
I am trying to create .vsix extension
then yeah nevermind, I misread it and thought you meant the rightclick file context menu in explorer
wel yes, but solution explorer 😅
You should probably include the VS version you are extending with too
since vsix is for both vs code and vs, and all verisons of both
but the code itself might be different
vs 2022
the best i can do is
IDM_VS_CTXT_ITEMNODE
, but that still doesn't workI suggest you edit the topic to "How to add command to right click context menu for solution explorer in VS 2022 extension"
Good luck
thanks
@admsnyder has made extensions, so maybe he can answer if he is available 🙂
hopefuly, because now it seems like i broke everything and it doesn't show up even at the default location
@binto86 yeah, you can add context menu commands
let me get to my pc and load a solution where i do that.
i have deleted everything in debug folder and set the id to
IDG_VS_WNDO_OTRWNDWS1
, rebuild and i see it under view-> other windows
but when i did it again with IDM_VS_CTXT_ITEMNODE
i still see it under view-> other windowsi wonder if there aren't examples online.
all i found after 30 mins of search was
IDM_VS_CTXT_ITEMNODE
which doesn't work, even if i rebuild its still under view->other windowslet me have a look...
did you look in here?
https://github.com/Microsoft/VSSDK-Extensibility-Samples
GitHub
GitHub - microsoft/VSSDK-Extensibility-Samples: Samples for buildin...
Samples for building your own Visual Studio extensions - GitHub - microsoft/VSSDK-Extensibility-Samples: Samples for building your own Visual Studio extensions
nope thank you that looks very usefull
ii still have a problem with running it
it looks like its running some older version of the files
when i delete all from debug folder, rebuild etc it still shows the old stuff
sometimes you gotta ++ the version in the vsixmanifest
now it looks like it works, but if i try to show it under solution explorer, it doesn't show up, but i guess that i have wrong id, thanks for your help
there's a sample for how to build your own VSS provider in the archived samples... i know that there, solution explorer context menu entries are created - that's where i'd look.
i know that, because i used that sample for my vss extension...
i have managed to add my command to the context menu, thanks for all your help
now i just need to figure out how to show it based on file extension and i can start working on the real extension
what is your extension supposed to do?
i wanted to try to do something similar to winforms designer but for blazor
i still don't have filter on file extension tho
do you have sketches on how the UI should look? because webforms is a thing and people don't seem to like it...
Nope just general idea for now, also i don't care much, even if i should be only person to use it, i want to quickly drag and drop some stuff, to get general idea how it should look and change details in the code
@admsnyder my problem is that it looks like any of the code runs after i click the button, so i have no idea how to check for file extension in code, i am trying to do something with the
VisibilityConstrains
tag in .vsct file, but not successfully
ok i got it working to show up only on .razor files! 🥳