How to get app version in Windows Phone?

Viewed 19031

In C# one can use System.Version.Assembly to get the version of a running app. However this doesn't appear to exist in Silverlight for Windows Phone. Is there an alternative?

11 Answers
System.Text.RegularExpressions.Regex regexVersion = new System.Text.RegularExpressions.Regex(@".*(?<v>\d+.\d+.\d+.\d+).*");
System.Text.RegularExpressions.Match regexVersion_Match = regexVersion.Match(System.Reflection.Assembly.GetExecutingAssembly().FullName);
string appVersion = "";
if (regexVersion_Match.Success)
    appVersion = regexVersion_Match.Groups["v"].Value;
Related