question

TheodoreHall-6047 avatar image
0 Votes"
TheodoreHall-6047 asked YanGu-MSFT answered

Why does the order of items in <Capabilities> of Package.appxmanifest matter?

I want to comment on the previous Q&A item, but it's already closed. The accepted answer doesn't work for me.

I see "invalid child element" schema errors for rescap:Capability elements no matter where I put them in the Capabilities list, relative to plain Capability, uap:Capability, and DeviceCapability. I have this for the Package attributes in AppxManifest.xml

 <Package
   xmlns          = "http://schemas.microsoft.com/appx/manifest/foundation/windows10"
   xmlns:uap      = "http://schemas.microsoft.com/appx/manifest/uap/windows10"
   xmlns:desktop4 = "http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
   xmlns:uap10    = "http://schemas.microsoft.com/appx/manifest/uap/windows10/10"
   xmlns:rescap   = "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
   IgnorableNamespaces = "uap desktop4 uap10 rescap"
 >

I notice that I can use DeviceCapability with rescap:Capability Name values, but only because there's no schema validity check on the value.

<DeviceCapability Name = "userSystemId"/> ultimately seems to have the desired effect.

windows-uwp
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@TheodoreHall-6047 Could you tell me which capabilities you are using? It doesn’t matter if your “invalid child element” achema error is just a warning. Could you please provide a screenshot of the error for us to get more information about your scenario?

0 Votes 0 ·

Thank You, YanGu-MSFT. Here is the complete set of capabilities. I've attached screen shots to a separate reply to avoid exceeding 1000 characters here.

Capabilities
Capability Name = "internetClient"/
Capability Name = "internetClientServer"/
Capability Name = "privateNetworkClientServer"/
uap:Capability Name = "userAccountInformation"/
uap:Capability Name = "objects3D"/
rescap:Capability Name = "cortanaSpeechAccessory"/
rescap:Capability Name = "userSystemId"/
DeviceCapability Name = "location"/
DeviceCapability Name = "microphone"/
DeviceCapability Name = "proximity"/
DeviceCapability Name = "webcam"/
DeviceCapability Name = "usb"/
DeviceCapability Name = "humaninterfacedevice"/
DeviceCapability Name = "activity"/
DeviceCapability Name = "gazeInput"/
/Capabilities

0 Votes 0 ·

I finally figured out, after 15 minutes of frustration, that the Reply / Submit doesn't function if the text includes XML tags. I had to delete the < and > characters in order to submit my previous comment.

0 Votes 0 ·

Screen shots requested by YanGu-MSFT -- trying to attach images here, but the Upload button hangs.

0 Votes 0 ·

1 Answer

YanGu-MSFT avatar image
1 Vote"
YanGu-MSFT answered

Hello,
Welcome to Microsoft Q&A,

I implemented the Capabilities codes provided by you, and reproduce the "invalid child element" schema error in your screenshot. I checked the order of each Capability and found no problem based on the several Note of the document.

The green wavy line in the screenshot is just a reminder and does not affect the build and debug of the project and can be ignored. You could directly run your app to see if your app could run correctly.



If the response is helpful, please click "Accept Answer" and upvote it.
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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.