locked
[UWP]How to use a restricted capability ? RRS feed

  • Question

  • I try to get a information about MobileBroadbandModem.

    var modem = MobileBroadbandModem.GetDefault();

    I have declared the restricted capabilities as

    <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" />
        <DeviceCapability Name="location" />
        <DeviceCapability Name="wiFiControl" />
        <rescap:Capability Name="cellularDeviceIdentity"/>
        <rescap:Capability Name="cellularDeviceControl"/>
        <rescap:Capability Name="cellularMessaging" />
      </Capabilities>

    But it doesn't get me to compile a code. I got error

    error APPX0501: Validation error. error C00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 41, 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.

    I have replaces rescap:Capability  to rescap:DeviceCapability

    Result is the same

    error APPX0501: Validation error. error C00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 41, Column 6, Reason: Element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities}DeviceCapability' 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.

    it looks the rescap namespace doesn't exisis.

    What is I doing wrong ?

    Thanks

    Monday, May 23, 2016 6:05 PM

Answers

All replies

  • Hi,

    Please see: Special and restricted capabilities

    "Apps that apply the special-use capabilities require a company account to submit them to the Store. In contrast, restricted capabilities do not require a special company account for the Store, they are not available for developers to use. Restricted capabilities are available only to apps that are developed by Microsoft and its partners. For more information about company accounts, see Account types, locations, and fees."

    Please see this sample perhaps you missed something?

    https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/MobileBroadband


    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Tuesday, May 24, 2016 5:58 AM
  • Hi RSychev,

    For assistance with this issue, please contact our tech advisors here. Thank you.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 24, 2016 8:57 AM
  • Hello,

    I have exactly the same issue !

    Did you find somethings to get it work ?

    Thanks


    Guillaume D.

    Wednesday, June 22, 2016 8:43 PM
  • It looks like you cannot declare both DeviceCapbilities and restricted capabilities at the same time.

    I get the error if these are my capabilities:

    <DeviceCapability Name="webcam" />
    <DeviceCapability Name="microphone" />
    <Capability Name="internetClient" />
    <Capability Name="privateNetworkClientServer" />
    <rescap:Capability Name="enterpriseDataPolicy"/>

    Then if I remove the two DeviceCapabilities, it works fine.

    <Capability Name="internetClient" />
    <Capability Name="privateNetworkClientServer" />
    <rescap:Capability Name="enterpriseDataPolicy"/>

    Is this a bug or expected? How can we add both device capabilities and restricted capabilities?

    Friday, July 15, 2016 2:58 PM
  • Hi FUR10Ngt,

    I have the same issue, but I found the work..workaround? about this.

    It seems that we should keep the order of each elements. For example, the following is NG. It cause the compile error.

      <Capabilities>
        <DeviceCapability Name="location" />
    <Capability Name="internetClient" /> <rescap:Capability Name="locationHistory"/> </Capabilities>

    But...but, the following is OK.

      <Capabilities>
        <Capability Name="internetClient" />
        <rescap:Capability Name="locationHistory"/>
        <DeviceCapability Name="location" />
      </Capabilities>

    It seems that... we should keep the order of elements as 'Capability', 'rescap:Capability', then 'DeviceCapability'.

    • Proposed as answer by IoT Chris Monday, February 6, 2017 9:20 PM
    Friday, July 29, 2016 1:52 PM
  • I appreciate that this a much later than this post.. but... I'm having the exact same problem with broadFileSystemAccess.

    The text you quoted has changed and now says:

    Apps that declare special-use capabilities require a company account to submit them to the Store. In contrast, restricted capabilities do not require a special company account for the Store. Restricted capabilities are available for developers to use in their app, but require approval for store submission. For more information about company accounts, see Account types, locations, and fees.

    Which to me suggests we should be able to use restricted capabilities (which broadFileSystemAccess) in our own apps, and even submit them to the Store as a non-company developer, although we'll have to really be able to justify its use.

    I'm writing filesystem tools like file scanners and duplicate file/file security utilities. I write these in classic WPF because it doesn't get in my way. I'd love to move to UWP, and broadFileSystemAccess seems to solve my problem.. except I can't seem to actually access it. In fact, I can't access any restricted capabilities.

    I'm using VS2017 on Windows 10 16299.371 targetting SDK 10.0.16299.0. I've also tried this with Insider 17233/17125

    So, either someone's deleted really important information about restricted capabilities, or someone's broken access to it.

    Saturday, April 14, 2018 8:54 PM
  • You may target to the latest Windows and try again. I'm using broadFileSystemAccess now.
    Wednesday, May 16, 2018 1:29 AM
  • Im having the same issue where Visual Studio CE does not recognize the rescap capability!

    The "restricted capabilities" are clearly absolutely critical for UWP devs, I understand they cant go on the Windows Store but Sideloading should be 100% possible to use them!

    Please tell me there is a way to do this now.

    Friday, June 1, 2018 9:49 PM