管理 WMAppManifest 文件中列出的应用程序“功能"的正确方法是什么? [英] What is the correct way to manage app 'Capabilities' listed in the WMAppManifest file?

查看:25
本文介绍了管理 WMAppManifest 文件中列出的应用程序“功能"的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在几个地方读过,包括这里http://blogs.msdn.com/b/jaimer/archive/2010/04/30/windows-phone-capabilities-security-model.aspx 如果是 Windows Phone应用不需要功能,那么您应该将其从清单中删除.

I've read in several place, include here http://blogs.msdn.com/b/jaimer/archive/2010/04/30/windows-phone-capabilities-security-model.aspx that if a Windows Phone app doesn't need a capability, then you should remove it from the manifest.

我认为我有一个应用不需要任何功能.

I have an app that I don't believe needs any of the capabilities.

当我从清单文件中删除所有功能时,一切似乎都很好,直到我做两件事之一.

When I removed all of the capabilities from the manifest file, everything seems fine until I do one of two things.

一,如果我在 Visual Studio 2010 中关闭并重新打开项目,则 Visual Studio 会抱怨以下错误:

One, If I close and re-open the project in Visual Studio 2010, then Visual Studio complains with the following error:

您正在使用一个由以前版本的 Windows Phone开发者工具 CTP.你的申请可能无法正常运行.

You are using a project created by a previous version of Windows Phone Developer Tools CTP. Your application may not run properly.

请编辑 WMAppManifest.xml 文件在 Properties 节点下并插入以下元素之间元素如下图所示.

Please edit the WMAppManifest.xml file under Properties node and insert the following elements between element as show below.

然后它会列出所有功能.

and then it lists all of the capabilities.

导致问题的第二个地方是当我尝试在手机上调试应用程序时.我在这里阅读 http://blog.adamnathan.net/2010/11/09/ThisAppMakesUseOfYourPhonesDataConnection.aspx 如果我想在手机上调试我的应用程序,即使我的应用程序在正常使用期间不需要它,我也需要在清单中添加此功能.这似乎是正确的,但是当我想将我的应用程序提交到市场时,必须添加此功能并记住将其删除是一个真正的麻烦.

The second place this causes an issue is when I try to debug the app on my phone. I read here http://blog.adamnathan.net/2010/11/09/ThisAppMakesUseOfYourPhonesDataConnection.aspx that I need to add this capability in the manifest if I want to debug my app on my phone even if my app doesn't need it durning normal use. This appears to be true, but it is a real hassle to have to add this capability and then remember to remove it when I want to submit my app to the marketplace.

那么管理这个的正确方法是什么?如果我将它们保留在清单中,市场是否会将我的应用标记为使用所有功能?

So what is the correct way to manage this? Will the marketplace flag my app as using all of the capabilities if I leave them in the manifest?

[更新:2011 年 1 月 1 日下午 4:58]虽然错误消息告诉我重新添加所有功能,但如果我只添加网络功能,Visual Studio 将停止抱怨.

[Update: 1 Jan 2011 4:58PM] While the error message tells me to add all of the capabilities back, Visual Studio will stop complaining if I add just the Networking capability.

推荐答案

在大多数情况下,市场摄取过程将正确重写您的能力(注意 已知异常).

The marketplace ingestion process will rewrite your capabilities properly in most cases (noting this known exception).

您在重新打开项目时遇到的错误是在 4 月 CTP 中实现的逻辑,在此之前 部分未填充.因此,这是提示您修复 WMAppManifest.xml 以指定您的应用程序在首次打开在 March CTP 下创建的项目时所使用的必要.

The error you're getting when re-opening the project is logic that was implemented in the April CTP, prior to which the <Capabilities> section was not populated. So this was a prompt for you to fix your WMAppManifest.xml to specify the necessary <Capabilities> your app is using when opening projects created under the March CTP for the first time.

这似乎不适用于不使用此类功能的情况.这可能是平台团队应该考虑的问题.

It seems this doesn't cater for the case where no such capabilities are used. This may be something the platform team should look at.

在 10 月的更新中,发布了能力检测工具,允许您执行在摄取期间完成的本地能力检测.

In the October update the Capability Detection Tool was released allowing you to perform the capability detection localy that's done during ingestion.

如何:使用 Windows Phone 功能检测工具

有趣的 Adam 观察到的设备调试依赖于 ID_CAP_NETWORKING.目前不确定这是否是故意的,但你可以看到它是如何发生的.

Interesting Adam's observation with device debuging having a dependency on ID_CAP_NETWORKING. Not sure if that's intentional at the moment, but you can see how it might happen.

这篇关于管理 WMAppManifest 文件中列出的应用程序“功能"的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆