How to Apply broadFileSystemAccess in UWP

水 知 190 Reputation points
2023-10-20T13:52:36.9633333+00:00
I have searched tens of documents about the question, but non of them is usable.

I finally found a sample code:

<Package

  ...

  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"

  IgnorableNamespaces="uap mp uap5 rescap">

...

<Capabilities>

    <rescap:Capability Name="broadFileSystemAccess" />

</Capabilities>

However...

Here is my code:

<?xml version="1.0" encoding="utf-8"?>

<Package

  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"

  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"

  IgnorableNamespaces="uap mp rescap">

 ......

  <Capabilities>

    <Capability Name="internetClient" />

	  <Capability Name="broadFileSystemAccess"/>

  </Capabilities>

</Package>

No matter how I modify the line <Capability Name="broadFileSystemAccess"/>,

no matter if it's<Capability Name="broadFileSystemAccess"/> or <rescap:Capability Name="broadFileSystemAccess"/>, there still's an error:

error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 35, Column 17, Reason: 'broadFileSystemAccess' 违反了 'internetClient internetClientServer privateNetworkClientServer allJoyn codeGeneration' 的 enumeration 约束。 无法分析值为 'broadFileSystemAccess' 的属性 'Name'。	UWPcmdTest1	F:\UWPcmdTest1\bin\x86\Debug\AppxManifest.xml	

This is really upsetting... I liked UWP.
Developer technologies | Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Junjie Zhu - MSFT 21,646 Reputation points
    2023-10-23T02:21:10.0366667+00:00

    Hi @水 知 ,

    Welcome to Micrsoft Q&A!

    The official documentation of File access permissions on how to add broadFileSystemAccess is as follows.

    <Package
      ...
      xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
      IgnorableNamespaces="uap mp rescap">
    ...
    <Capabilities>
        <rescap:Capability Name="broadFileSystemAccess" />
    </Capabilities>
    

    I can reproduce the same behavior when I use <Capability Name="broadFileSystemAccess"/>. If I use <rescap:Capability Name="broadFileSystemAccess"/> as in the official documentation, and then 'Rebuild All', there is no error.

    If the problem still doesn't resolve after following the code in the document, please share the complete Package.appxmanifest.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.