C
C#13mo ago
ItsIlya

Windows 10/11 Custom Shell Context Menu items in C# (WinUI-3) using WinUICommunity/ShellContextMenu

I'm working on some WinUI-3 C# app trying to add a single item to Explorer's Context Menu. I found this library, ShellContextMenu (https://github.com/WinUICommunity/ShellContextMenu) Which apparently lets you do just that! There isn't much documentation about it. The first part of the instructions say to add some code to package.appxmanifest I tried adding the xmlns lines to the Package block and then adding the Exentions block in. But, that gives me an error that I don't even know what it means:
Severity Code Description Project File Line Suppression State
Error DEP0700: Registration of the app failed. [0x80080204] error 0xC00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 37, Column 6, Reason: Element '{http://schemas.microsoft.com/appx/manifest/desktop/windows10/4}Extension' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Extensions'.
Expecting: {http://schemas.microsoft.com/appx/manifest/foundation/windows10}Extension, {http://schemas.microsoft.com/appx/manifest/foundation/windows10}ExtensionChoice. Pin Explorer
Severity Code Description Project File Line Suppression State
Error DEP0700: Registration of the app failed. [0x80080204] error 0xC00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 37, Column 6, Reason: Element '{http://schemas.microsoft.com/appx/manifest/desktop/windows10/4}Extension' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Extensions'.
Expecting: {http://schemas.microsoft.com/appx/manifest/foundation/windows10}Extension, {http://schemas.microsoft.com/appx/manifest/foundation/windows10}ExtensionChoice. Pin Explorer
I tried looking for other ways to do this but no luck. So I think my current option is to try this library. I'd appreciate any help, this is literally my first time using C#, WinUI. After searching for a whole day, at first it looked like a hell, but now it does feel like one 💀
GitHub
GitHub - WinUICommunity/ShellContextMenu: add a new ContextMenu for...
add a new ContextMenu for Windows 11/10. Contribute to WinUICommunity/ShellContextMenu development by creating an account on GitHub.
4 Replies
Accord
Accord13mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
reflectronic
reflectronic13mo ago
can you show what your appxmanifest looks like fully
ItsIlya
ItsIlya13mo ago
I figured out that I needed to add the Extensions inside of the Applications.Application block. The problem is that now I got two of them. I think I registered one before and then removed and uninstalled that app to see what would happen and now there are two Open With menus with two submenus each. and neither show up on the classic menu I'm not sure if it's because of the library or not. I tried looking into how it was done for VSCode and NanaZip but couldn't really understand what was happening and I only saw IExplorerCommand cpp files which I think are for the older context menu?
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.