C#C
C#•3y 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            


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 💀
image.png
GitHub
add a new ContextMenu for Windows 11/10. Contribute to WinUICommunity/ShellContextMenu development by creating an account on GitHub.
Was this page helpful?