This evening I was working on our Event Board application, and needed to write some code that would check the version number of the running Windows Phone 7 application.
In the full .NET framework, that can be easily done like so:
But on the phone, access to Assembly.GetName is restricted to the .NET framework itself, and trying to call it throws a runtime exception (as you might guess from the [SECURITY CRITICAL'] on the tooltip above).
Well, long story short, here is a workaround that does work: calling Assembly.GetExecutingAssembly().FullName is allowed, which will give you a string like ...