microsoft / AppModelSamples

Sample code for AppModel features
MIT License
200 stars 102 forks source link

SparsePackages/PhotoStoreContextMenu does not work on Windows 11 #25

Open dhoelzl opened 3 years ago

dhoelzl commented 3 years ago

I have worked through the instruction how to run the SparsePackages/PhotoStoreContextMenu example, but I cannot see any context menu entries from the example in Windows Explorer.

Starting PhotoStoreDemo.exe displays "(Running with Identity)" in the Window caption, so I assume the registration was successful.

Checking the sparse package:

PS C:\Users\vagrant> get-appxpackage -name *photostore*

Name : PhotoStoreDemo Publisher : CN=Contoso Architecture : Neutral ResourceId : Version : 1.0.0.0 PackageFullName : PhotoStoreDemo_1.0.0.0_neutralh91ms92gdsmmt InstallLocation : C:\Program Files\WindowsApps\PhotoStoreDemo_1.0.0.0_neutralh91ms92gdsmmt IsFramework : False PackageFamilyName : PhotoStoreDemo_h91ms92gdsmmt PublisherId : h91ms92gdsmmt IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False IsPartiallyStaged : False SignatureKind : Developer Status : Ok

I have double-checked the path to the Binaries ("externalLocation") and the msix-File ("sparsePkgPath").

I did not get any error while working through the instructions.

How to analyze the problem?

I have one further question:

How can I register the sparse package via command line (PS / Add-AppxPackage) with the external location? So far I only found a way to pass the path to the *.msix-File but not the binary location of the external application.

OS Version: Windows 11 21H2 (OS Build 22000.194)

Thank you and regards, Dominik

MikeCoder96 commented 2 years ago

I confirm, no entry in the context menu! Only share option is available.

This is the context menu for a txt file and we can se there is no Command1, Command2, Command3, Command 5 image

This is Directory\Background, no Command1 image

The only thing that work is option for JPG file work, here the screenshot: image

Please Fix it!

l-eugine commented 2 years ago

Faced same issue, after several hours was able to resolve it - in my case it was missing vc runtime libraries. I've used procmon.exe to see what happened - in my case PhotoStoreContextMenu.dll was loaded by dllhost.exe, but shortly after that it failed to locate vcruntime140d.dll and other debug runtime libraries. I've compiled x64 debug version of sample application and deployed on win11 virtual machine. After placing all missing debug dlls next to PhotoStoreContextMenu.dll I could see context menu item: image

Maybe it could help someone else.

Loqaritm commented 2 years ago

I was also able to resolve this issue by including the missing libraries, though I did not do so manually - instead I just installed VS19 with the .NET Desktop Development and Desktop development with C++ workloads on my testing win11 virtual machine.

modz2014 commented 5 months ago

uploading package release would help as well