Search code examples
c#uwpwindows-10win-universal-appwindows-10-universal

how to add my UWP app to the list of Windows 10 apps that can access the file system?


How do I add my UWP C# app to the Windows 10 File System Privacy Settings to allow my app's broadFileSystemAccess to access the file system?

When I open File System Privacy Settings, beneath "Choose which apps can access you file system" I can't figure out how to add my app to the apps listed there.

MANIFEST VALIDATION ERROR (caused by deployment of app )...

Validation error. error C00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 50, Column 6, Reason: Element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities}Capability' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Capabilities'. Expecting: {http://schemas.microsoft.com/appx/manifest/foundation/windows10}DeviceCapability. MOBILE UPLOADER C:\PRIMARY\WORK\MOBILE UPLOADER\Samples\CameraFrames\cs\bin\x64\Debug\AppxManifest.xml

Screen shot of mouse hover popup of error in manifest after adding recommendation from answer 1... enter image description here

So, I changed the manifest as per the above "Expecting" recommendation, deployed, and got this error:

Error DEP0700: Registration of the app failed. [0x80073CF6] AppxManifest.xml(52,6): error 0x80070002: Cannot map the broadFileSystemAccess well-known device name to a device interface GUID for the Microsoft.SDKSamples.CameraFrames.CS_1.0.0.0_x64__8wekyb3d8bbwe package. Check that the device name is correct. MOBILE UPLOADER

How do I correct that?

LATEST APP MANIFEST...

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" 
                 xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" 
    xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" 
    xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" 
    IgnorableNamespaces="uap mp">
  <Identity Name="Microsoft.SDKSamples.CameraFrames.CS" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.0.0.0" />
  <mp:PhoneIdentity PhoneProductId="2344b9de-5071-42a6-8873-7fdeb38d53dd" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
  <Properties>
    <DisplayName>Camera Frames C# Sample</DisplayName>
    <PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
    <Logo>Assets\StoreLogo-sdk.png</Logo>
  </Properties>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.15063.0" MaxVersionTested="10.0.17134.0" />
  </Dependencies>
  <Resources>
    <Resource Language="x-generate" />
  </Resources>
  <Applications>
    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="CameraFrames.App">
      <uap:VisualElements DisplayName="MOVANO System Hub Camera  interface" Square150x150Logo="Assets\SquareTile-sdk.png" Square44x44Logo="Assets\SmallTile-sdk.png" Description="Camera Frames C# Sample" BackgroundColor="#00b2f0">
        <uap:SplashScreen Image="Assets\Splash-sdk.png" />
        <uap:DefaultTile>
          <uap:ShowNameOnTiles>
            <uap:ShowOn Tile="square150x150Logo" />
          </uap:ShowNameOnTiles>
        </uap:DefaultTile>
      </uap:VisualElements>
      <Extensions>
        <uap:Extension Category="windows.fileTypeAssociation">
          <uap:FileTypeAssociation Name="access">
            <uap:SupportedFileTypes>
              <uap:FileType>.txt</uap:FileType>
              <uap:FileType>.bin</uap:FileType>
            </uap:SupportedFileTypes>
          </uap:FileTypeAssociation>
        </uap:Extension>
      </Extensions>
    </Application>
  </Applications>
  <Capabilities>
    <Capability Name="privateNetworkClientServer" />
    <Capability Name="internetClientServer" />
    <DeviceCapability Name="microphone" />
    <DeviceCapability Name="webcam" />
        <DeviceCapability xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" 
                                         Name="broadFileSystemAccess"/>  
    </Capabilities>
</Package>

UWP PROJECT PROPERTIES

enter image description here


Solution

  • Answer: Visual Studio > Build > Deploy Then, press Window key and search FILE SYSTEM PRIVACY SETTINGS You'll see your app.

    You can enable it, in order to enable file access (for BroadFileSystemAccess)