johnvisiomvp

Life with Visio and other Microsoft Toys!

WP7 Full samples May Not Be Enough

with one comment

Though some of the features are pretty straight forward, some of them require having hooks all over the place. So I try to find fully working examples. Recently I came across a sample app that creates a statistics page that can be used to display information for an About’s page. The good thing was that it was simple and there was no extraneous items to distract the developer. Unfortunately, copying the C# and XAML to a new page in one of my apps caused the app to fail with an ArgumentNullException error. The suggested tip was to use the NEW keyword. Except for the name of the pages, the new XAML and C# pages appeared to be identical. Since this was a very simple example, there was not too many other places to look and they appeared to be identical. Thanks to my friend Peter Henry,he told me to add
<Capability Name=”ID_CAP_IDENTITY_DEVICE”/>
<Capability Name=”ID_CAP_IDENTITY_USER”/>

to the Capabilities in the WMAPPManifest.xml. For some reason, I only considered these to be comments that were need to have the app validated for the marketplace. It had not dawned on me that these really affected the generated code.

Another lesson learned.

John Marshall… Visio MVP       Visio.MVPs.org

Advertisements

Written by johnvisiomvp

October 13, 2011 at 2:06 pm

Posted in C#, Windows Phone 7, WP7

Tagged with ,

One Response

Subscribe to comments with RSS.

  1. I hear that PHenry guys just a coffee swilling pro-MSer, WP7 pushing geek? DOH! :>

    But seriously, in the beginning (WP7 beta) I believe your assessment was right, those Capability entries were there for Marketplace entry and consumer notification/benefit only. Somewhere between the first beta and now (I think it was with one of the 7.0 SDK updates), the Capabilities were enforced in the compiler/emulator. That might explain why the original code worked (in 7.0 betas?) but not now in your updated, Mango 7.5 SDK code. (yes, I’m stretching and looking for the silver lining :>).

    The GREAT news though is, YOU FIXED IT! :> You figured it out, fixed it, and blogged about it for others like you to learn! KUDOS!

    phenry9999

    October 13, 2011 at 2:21 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: