管理应用程序“功能”的正确方法是什么?在 WMAppManifest 文件中列出?

发布于 2024-10-09 19:29:07 字数 1108 浏览 0 评论 0原文

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

我有一个我认为不需要任何功能的应用程序。

当我从清单文件中删除所有功能时,一切看起来都很好,直到我做了两件事之一。

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

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

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

然后它列出了所有功能。

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

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

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

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.

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

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

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.

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?

[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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌面超妹 2024-10-16 19:29:07

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

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

这似乎不适合不使用此类功能的情况。这可能是平台团队应该考虑的事情。

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

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

Adam 对依赖 ID_CAP_NETWORKING 的设备调试的观察很有趣。目前不确定这是否是有意为之,但您可以看到它是如何发生的。

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

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.

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

How to: Use the Windows Phone Capability Detection Tool

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文