The Pivot and Panorama tutorial out of the Windows Phone 7 Training Kit is one of my favorite tutorials to refer folks to. Not only does it showcase the Phone7 unique Panorama and Pivot navigational experiences, but it also makes good use of JSON parsing against twitter, as well as using the digg APIs.
During the Boston Windows Phone 7 loadfest an attendee was asking me about json parsing, so I told him to just open the ‘end’ lab ( C:\WP7TrainingKitOffline\Labs\UsingPivotAndPanoramaControls\Source\Ex3-Panorama\End ) to see a demo of json usage. After demoing, I wanted them to work through the lab doc for some understanding.
Low and behold, a small booboo occurs trying to get it going. I’ve blogged the booboo and resolution here for all posterity (and some SEO hopefully) in an attempt to save some folks a bit of time in the future.
First, opening up the “end” project, and try doing a Build / Rebuild or just run from express.
Ouch, You’ll get following 3 nasties:
Error 1 The type or namespace name ‘ServiceModel‘ does not exist in the namespace ‘System’ (are you missing an assembly reference?) C:\WP7TrainingKitOffline\Labs\UsingPivotAndPanoramaControls\Source\Ex3-Panorama\End\Wazup\Services\BlogService.cs 21 14 Wazup
Warning 2 Could not resolve this reference. Could not locate the assembly “System.ServiceModel.Syndication“. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. Wazup
Warning 3 The referenced component ‘System.ServiceModel.Syndication‘ could not be found
If you poke around in the errors list you’ll also see it can’t find the namespace System.Runtime.Serialization.Json or the class DataContractJsonSerializer.
OK, from past I know System.ServiceModel.Syndication is in the Sivlerlight SDK at C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client .
Add a reference to System.ServiceModel.Syndication.DLL from the SL SDK directory.
You’ll get a nasty about Silverlight assemblies in this project may not work right, ignore it. Message is as follows – “Microsoft Visual Studio – Adding a reference to a Silverlight assembly may lead to unexpected application behavior. Do you want to continue?”
I was a bit concerned re pulling in the SL4 SDK lib for JSON parsing. I checked with the redmond guys on this point specifically and they said its the way to go.
Rebuild it, good to go, give it a run
Hope this gets picked up by a search engine and saves someone some time. Enjoy.
This post written specifically for you as I was entertained by zunepass and Cobra Verde’s Copycat Killers. Discoverd with Zune Picks.