Restricted capabilities on UWP apps

别来无恙 提交于 2019-11-30 09:45:23

问题


I want to make screen projection application. And according to MSDN I need a rescap namespace in Package.appxmanifest. I Wrote thisxmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities", but namespace does not appears. Do I need something more?


回答1:


In the Package.appxmanifest when you add the rescap namespace, add 'rescap' to the IgnorableNamespaces property.

<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">

Edited: VS tells you "Capability" aren't into "rescap" namespace and doesn't let you build the application. Adding the name to the IgnorableNamespaces let you use the "rescap" namespace without breaking the application and letting you use the restricted capability.




回答2:


To Add "Screen Projection Capability", you can include following two lines in "package.manifest":

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

<Capabilities>
<rescap:Capability Name="screenDuplication "/>
</Capabilities>

Besides, you can find a projection sample, which use ProjectionManager and ApplicationViewSwitcher APIs.

To Cristian: I don't think his problem is related with "IgnorableNamespaces", which is more about backward capability.




回答3:


Developer account can't use the Special and restricted capabilities,for that company account has need.



来源:https://stackoverflow.com/questions/33981364/restricted-capabilities-on-uwp-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!