windows phone 7

After moving some files my Windows Phone Project Throws a XamlParseException

I am not sure if this is an known issue for Microsoft, but at least I am aware of this. However this is the first time I am gonna document it. Since it can be very frustrating

The Problem

I want to reorganize the files in my Windows Phone Project in order to follow our implementation of MVVM, moreover we have decided that resx file will live in their own assembly project. However, once I move the Resource file to an external assembly the application just thrown an XamlParseException even though the reference in XAML is totally correct.

XamlParseExceptions may be thrown by other reasons. It is important to realize that I knew I moved the RESX file to a different assembly and before that everything was working. Certainly I updated the reference to the new assembly, and the exception was still being thrown. That is why this is a tricky issue.

The solution

It took some time to me to noticed, but somehow the project that contains the RESX file cannot contain a dot (.) character in its assembly name. If it happens then XAML parse will throw a XamlParserException even though the reference to the assembly is correct. The error message may contain something like this:

System.Windows.Markup.XamlParseException occurred
  Message=Unknown parser error: Scanner 2147500037. [Line: 10 Position: 126]
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at MyApp.App.InitializeComponent()
       at MyApp.App..ctor()

Taking a look at the location where I was loading the Resource it was this:


    <!--Application Resources-->
        <local:LocalizedStrings xmlns:local="clr-namespace:MyApp;assembly=MyApp.WindowsPhone8.Resources" x:Key="LocalizedStrings"/>

        <!--Required object that handles lifetime events for the application-->
            Launching="Application_Launching" Closing="Application_Closing"
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>


The line one of my projects generates an assembly named: ‘MyApp.WindowsPhone8.Resources’, in order to resolve the issue I only have to update the generated assembly name to be ‘MyApp_WindowsPhone8_Resources’ and then update the proper reference in the XAML. For example:

        <local:LocalizedStrings xmlns:local="clr-namespace:MyApp;assembly=MyApp_WindowsPhone8_Resources" x:Key="LocalizedStrings"/>

After performing this change your app should work normally.

WP7: Libraries about Cloud services (Azure, AWS, Hawaii), Toolkits (WP7) and more


I’d like to share with you some of the libraries that I’ve been reading (or using in some cases) in WP7 projects.

Silverlight for Windows Phone Toolkit @
This might be the only one that should be mandatory in your WP7 project. This library contains a set of controls to enhance the WP7 experience by adding custom animations and custom controls. 

Reactive Extensions for Windows Phone 7 @
This library helps you to control Asynchronous tasks or events. It’s like creating pipes based on asynchronous events.

Hawaii Cloud Services SDK for Windows Phone 7 @
This particular project is for non-commercial projects, and at this time it’s free because it’s a research project. This project lets use use the cloud services in order to have services such as: Speech to Text (aka voice recognition), OCR among others.

[watwp] Windows Azure Toolkit for Windows Phone 7 @
A simple way to access Azure services thru your WP7.

Amazon Web Services SDK for Windows Phone 7 @ (
Well for those how have worked with AWS, this library will simplify some of the tasks accessing services such as S3 (which is web storage).

[PAARC] Phone as Remote Control @ (—Desktop-integration-out-of-park-with-PAARC-the-Phone-as-a-Remote-Control-library)
I really like this one. It’s just a simple (and efficient) mechanism to establish a connection between your phone and your PC. Thus, the phone will work as a input device, and the PC has already a running a service which will report all the input generated by the phone.

Zune Web API @
This is not exactly an SDK, but it will help you to get information from your Zune account 😉

Best regards,