Skip to content

Latest commit

 

History

History

StoragePickers

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

The Storage Pickers Samples

  • Demonstrates the Microsoft.Windows.Storage.Pickers APIs inside a Windows App SDK app.
  • Targets Windows App SDK 1.8 or later.
  • Three tabs showcase FileOpenPicker, FileSavePicker, and FolderPicker usage end to end.

📸 Screenshot of App Layout

img

Deploy the Sample Packaged App Locally

  1. Open cpp-sample/FilePickersAppSinglePackaged.sln or cs-sample/FilePickersAppSinglePackaged.sln in Visual Studio, right click on the project, select "Package and Publish" > "Create App Package"

img

  1. Select Sideloading > Next

img

  1. Create and Trust your own test certification

img

img

  1. Create package

img

  1. Open the built result

img

  1. Run Install.ps1 in powershell

img

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 error: img

Screenshot of this mitigation:

img

With the dependency *.appx files correctly installed, the project should be debugged in Visual Studio smoothly.

img

🚀 Run

  1. Open cpp-sample/FilePickersAppSinglePackaged.sln or cs-sample/FilePickersAppSinglePackaged.sln in Visual Studio.
  2. Restore NuGet packages and ensure the Windows App SDK 1.8 runtime is installed locally.
  3. Build and run.

More to explore