如何将我的UWP应用程序添加到可以访问文件系统的Windows 10应用程序列表中?

问题描述 投票:0回答:2

如何将我的UWP C#应用程序添加到Windows 10文件系统隐私设置以允许我的应用程序的broadFileSystemAccess访问文件系统?

当我打开文件系统隐私设置时,在“选择哪些应用程序可以访问您的文件系统”下面,我无法弄清楚如何将我的应用程序添加到其中列出的应用程序。

显示验证错误(由应用程序部署引起)......

验证错误。错误C00CE014:应用清单验证错误:应用清单必须按模式有效:第50行,第6列,原因:根据父元素'{http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities}功能'的内容模型,元素'{http://schemas.microsoft.com/appx/manifest/foundation/windows10}功能'是意外的。期待:{http://schemas.microsoft.com/appx/manifest/foundation/windows10} DeviceCapability。 MOBILE UPLOADER C:\ PRIMARY \ WORK \ MOBILE UPLOADER \ Samples \ CameraFrames \ cs \ bin \ x64 \ Debug \ AppxManifest.xml

从答案1 ... enter image description here添加推荐后,鼠标悬停弹出窗口中的错误

所以,我根据上面的“Expecting”建议更改了清单,部署并得到了这个错误:

错误DEP0700:应用程序注册失败。 [0x80073CF6] AppxManifest.xml(52,6):错误0x80070002:无法将broadFileSystemAccess已知设备名称映射到Microsoft.SDKSamples.CameraFrames.CS_1.0.0.0_x64__8wekyb3d8bbwe程序包的设备接口GUID。检查设备名称是否正确。移动上传者

我该如何纠正?

最新的应用程序清单...

<?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项目属性

enter image description here

c# uwp windows-10 win-universal-app windows-10-universal
2个回答
4
投票

将此行添加到您应用的清单文件中并部署您的应用。然后它将显示在隐私设置的该部分中:

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


0
投票

答案:Visual Studio> Build> Deploy然后,按Window键并搜索FILE SYSTEM PRIVACY SETTINGS您将看到您的应用程序。

您可以启用它,以便enable file access (for BroadFileSystemAccess)

© www.soinside.com 2019 - 2024. All rights reserved.