- Demonstrates the
Microsoft.Windows.Storage.PickersAPIs inside a Windows App SDK app. - Targets Windows App SDK 1.8 or later.
- Three tabs showcase
FileOpenPicker,FileSavePicker, andFolderPickerusage end to end.
- Open
cpp-sample/FilePickersAppSinglePackaged.slnorcs-sample/FilePickersAppSinglePackaged.slnin Visual Studio, right click on the project, select "Package and Publish" > "Create App Package"
- Select Sideloading > Next
- Create and Trust your own test certification
- Create package
- Open the built result
- Run Install.ps1 in powershell
Note:
If encountering error like below:
Add-AppxPackage: Cannot find path 'C:\FilePickersAppSinglePackaged_1.0.1.0_x64_Debug_Test\Dependencies\x86\Microsoft.VCLibs.x86.Debug.14.00.appx C:\FilePickersAppSinglePackaged_1.0.1.0_x64_Debug_Test\Dependencies\x86\Microsoft.VCLibs.x86.Debug.14.00.Desktop.appx C:\FilePickersAppSinglePackaged_1.0.1.0_x64_Debug_Test\Dependencies\x64\Microsoft.VCLibs.x64.Debug.14.00.appx C:\FilePickersAppSinglePackaged_1.0.1.0_x64_Debug_Test\Dependencies\x64\Microsoft.VCLibs.x64.Debug.14.00.Desktop.appx' because it does not exist.
Replace lines 483-491 in Add-AppDevPackage.ps1 with below script and try again:
if ($DependencyPackages.FullName.Count -gt 0)
{
Write-Host $UiStrings.DependenciesFound
$DependencyPackages.FullName
# Install dependencies one by one first
foreach ($dep in $DependencyPackages.FullName) {
echo "Installing dependency: $dep"
try {
Add-AppxPackage -Path $dep -ForceApplicationShutdown
echo "Successfully installed: $dep"
} catch {
echo "Failed to install dependency: $dep - $($_.Exception.Message)"
}
}
# Now install the main package
echo "Installing main package: $($DeveloperPackagePath.FullName)"
Add-AppxPackage -Path $DeveloperPackagePath.FullName -ForceApplicationShutdown
}Screenshot of this mitigation:
With the dependency *.appx files correctly installed, the project should be debugged in Visual Studio smoothly.
- Open
cpp-sample/FilePickersAppSinglePackaged.slnorcs-sample/FilePickersAppSinglePackaged.slnin Visual Studio. - Restore NuGet packages and ensure the Windows App SDK 1.8 runtime is installed locally.
- Build and run.










