Migrating to Mango – Developer View. Part 2

Part 1 of this article is available here.

New compiler

Just for curiosity: Let’s look first at the influence of the new compiler. Strictly speaking this is not the result of the Mango update, but if you did not install VS SP1 (my case), Mango requires it. I took an existing project, saved its output (i.e. a dll file) and recompiled it to get the new dll file. Binary comparison of the old/new output dll’s shows too many differences, but I have a strong feeling that substantial part of them are simple code shifts. I opened both old and new dll in the Reflector, extracted the sources (remarkably readable, BTW) and compared them.

Result: Sources are basically identical. The only difference was a formal one – ordering of TemplatePartAttribute’s in the class declarations. As expected, compiler changes won’t play any role for us (hopefully).

What was installed actually?

Back to Mango. Let’s look at the files installed on the computer.

The emulator resides in:

C:\Program Files (x86)\Microsoft XDE

and was apparently overwritten by 7.1 SDK. (An irreversible change.)

Old phone assemblies are located in the folder:

C:\ProgramFiles(x86)\ReferenceAssemblies\Microsoft\Framework \Silverlight\v4.0\Profile\WindowsPhone

This folder contains copy of all system assemblies installed on the pre-Mango phones. It was here since ages and its content was apparently not affected by new SDK installation. Instead, Mango phone assemblies were copied side-by-side to a new folder:

C:\ProgramFiles(x86)\ReferenceAssemblies\Microsoft\Framework \Silverlight\v4.0\Profile\WindowsPhone71

It looks like both 7.0 and 7.1 environments are available and the tools such as the emulator can decide which one to use.

Left: WP7.0 system assemblies, Right: WP7.1

Several things are worth noting:

  • WP7.1 contains several new assemblies (system.data.linq, mscorlib.extensions and several XNA assemblies). If you want to know what they contain open them in Reflector or read Mango documentation.
  • Most of the old WP7 assemblies have changed
  • Changed assemblies preserve old versions

Well, in the old good days we learned that versions are here to remove the so-called dll hell as they provide unique identification. Apparently the reality combining independent platforms (Silverlight, .NET, phone) is too complex to rely on the versioning info. Anyway, theoretical possibility that my future app using Mango-specific system classes would be run on WP7.0 phone worries me a bit.

New Concept – Profile

Well, the word “new” is not quite justified. The concept of profile was here before the Mango was introduced. It just wasn’t emphasized since only a single profile existed there. Microsoft uses the word Profile to denote Target Windows Phone Version. There are 2 profiles at present:

  • WindowsPhone
  • WindowsPhone71

You can easily verify above statement: Open a dll file file in a binary viewer and look for the string “Profile“. Old assemblies (dll files) contain the string “Profile=WindowsPhone“. As you probably guess, the assemblies built for Mango use the string “Profile=WindowsPhone71“.

Should this be the key concept that prevents the conflicts mentioned above?

Part 3 will come soon

About the author
Jan Slodicka
Programming for over 30 years. Covered several desktop platforms and programming languages. Since 2003 working for Resco on mobile technologies – Palm OS, Windows Mobile, Windows Phone 7, Android. You can contact me at jano (at) resco (dot) net.

One thought on “Migrating to Mango – Developer View. Part 2

  1. Pingback: Migrating to Mango – Developer View. Part 2

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