Skip to main content

Posts

SilverlightSerializer MissingMethodException on WP7

I wanted to start a list of common reasons why Silverlight Serializer throws the MissingMethodException exception. First off you need to make sure you've got a WP7 build of the Silverlight Serializer - you can get a copy from the WP7Contrib code base if you don't want to build your own. Classes causing MissingMethodException exception: System.Uri, System.Globalization.CultureInfo To correct the issue for the above classes you will have to implement a classes that acts a serialization proxy, the one shown below is for System.Uri. [Serializer(typeof(Uri))] public sealed class SerializeUri : ISerializeObject {     public object[] Serialize(object target)     {         return new object[] { ((Uri) target).ToString() };     }     public object Deserialize(object[] data)     {         retu...

WP7Contrib: Transient caching with In Memory Cache Provider

Rich  and I are currently working on a WP7 application based around local content stored on the device.   This content consists of a database and a set of flat files per logical item.   The content for the application can contain many of these logical items; this is determined by the user when purchasing the application.   The content is either installed along with the application at purchase or is downloaded afterwards. The application is completely self-contained and read-only – it doesn't allow modification of content. The application in theory has n number of these logical items; each logical item is queried for a set of data.   This data consists of information extracted from a database and flat files.   Once the data has been extracted it is then mapped into the required model.   This process could be repeated n number of times whilst the application is being used.   There is a time penalty in accessing the flat files & database...

WP7Contrib: Bing Maps REST Services Wrapper - Deep Dive

Following on from Rich's post introducing the Bing Maps Service in the WP7Contrib I'm going to explain in more detail how we built this service and how to use the API. Before I get into the details let’s get some background on what is provided by Microsoft out of the box.  Microsoft provides multiple APIs for programmatically integrating maps and map data into your WP7 applications as well as the UI based controls included in the Microsoft.Phone.Controls.Maps namespace. The APIs are designed to used in conjunction with the UI controls to annotate the visual elements of Bing Maps. The Bing Maps has it's own area up on MSDN, here . Microsoft supports both SOAP and REST APIs for accessing location, imagery, route and services information.  Each implementation has its own taxonomy and these are heavily influenced by the underlying protocol (as much as you can call REST a protocol).  The only advantage we can currently see with using the SOAP implementation over REST ...

WP7Contrib: Timing out HTTP requests on Windows Phone 7

This code uses change set #68097 of the WP7Contrib -  http://wp7contrib.codeplex.com/SourceControl/changeset/changes/68097 When doing communications over HTTP we often want to set a timeout for the response.  We want the ability to handle the timeout in a timely manner when the communication with a remote server has taken too long. When using the full version of the .Net framework we have the ability to control this precisely using the HttpWebRequest.Timeout property. The default value is set to 100 seconds. Unfortunately the ability to change this property is not supported on the Windows Phone 7 platform and I suspect the value is set to 100 seconds (should test this hypothesis). Looking around on the internet there are several approaches to get around this problem using the DispatcherTimer class and explicitly disposing of the request when the timeout has been exceeded, see an example  here . When using our ResourceClient to do RESTful communication over ...

Silverlight install error 1603 - 'Windows Installer Clean Up' to the rescue

Came across this error today whilst trying to install Silverlight for an enterprise LOB app, and as you know if you come across this error the support documentation on MSDN is pretty useless. The machine had the default Silverlight v3 install and we were trying to install an instance of v4. So first thoughts was local admin rights - I didn't have them, after finding someone who did, it was still failing. Next attempt was following the steps defined here but even after uninstall\reinstall still no luck. I started to think this was going to be a long afternoon. Then I remember a great little tool which is no longer available for download from MSDN -' Windows Installer Clean Up ', great little tool for cleaning the registry and file system of installed applications, but in the wrong hands this can totally wreak a machine, the reason why MS pulled it from MSDN, article here . Fortunately for me there's a copy on the corporate network, it's got a rather strange file...

Using ILMerge for Windows Phone 7

I needed to IL merge the WP7Contrib assemblies today and this was the first time I've need used the tool. So I wanted to document configuration required for WP7. Most of the information I found in the following posts, here & here , but neither specify the ' /targetplatform ' option for the WP7 platform which is the key piece of info. So for 32 bit you need: /targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone" And for 64 bit you need: /targetplatform:v4,"%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone" So putting what I read together I was able to create the following: "%programfiles%\microsoft\ilmerge\ilmerge.exe" /targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone" /out:WP7Contrib.dll ..\..\ILMergeAssemblyInfo.dll WP7Contrib.Caching.dll WP7...

Web API with WCF

I've built several RESTful APIs using both ASP.Net MVC2 and OpenRasta, it's good see I can now do the same very easily using the new open source WCF Web API . Glenn Block had a great presentation @ MIX11, check out the video There's a great description why going with a SOAP based web API doesn't scale well in todays current web landscape- using POST everywhere means intermediate caches can't help with GET styled SOAP requests, check out about 5 mins in... WCF Web API, "There's a uri for that" from Glenn Block on Vimeo .