UWP Manifest issue / restricted capability / inputForegroundObservation

人走茶凉 提交于 2020-01-11 13:19:27

问题


I'm trying to follow this StackOverflow article, referring to this similar article on StackOverflow, and this from the UWP Windows Dev Center.

In my manifest XML, the <Package> tag was updated to include xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" and also IgnorableNamespaces="uap mp wincap rescap".

My <Capabilities> section looks like this:

<Capabilities> <Capability Name="internetClient" /> <rescap:Capability Name="inputForegroundObservation" /> </Capabilities>

And <rescap:Capability is underlined with error:

"The element 'Capabilities'... has invalid child element...in...namespace.../windows10/restrictedcapabilities..."

(I snipped away much of the very long error message)

Any advice on how I can get the inputForegroundObservation Capability recognized? VS Community 2015 sp3, Microsoft.NETCore.UniversalWindowsPlatform package installed.

Cheers, Adam


回答1:


Answer:

  1. In the <package> tag, do not include wincap or rescap in IgnorableNameSpaces.
  2. You do not need a corporate account to build the app successfully and without error. I used the freely-downloadable Visual Studio Community 2015 fully updated as of 2017-03-03.
  3. The rescap:Capability Name= will continue to be underlined in the package XML editor, but this does not mean you will have any build warnings or errors.
  4. I put a comment in the MSDN documentation that says that rescap "must" be included in IgnorableNameSpaces - this was clearly throwing me off, and may well confuse others, also.
  5. More information here.

Hope this helps someone.

Cheers,



来源:https://stackoverflow.com/questions/42356911/uwp-manifest-issue-restricted-capability-inputforegroundobservation

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