开发者

What is the correct way to manage app 'Capabilities' listed in the WMAppManifest file?

开发者 https://www.devze.com 2023-02-01 20:18 出处:网络
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

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 开发者_JS百科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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消