Skip to content

Displaying the Assembly Version # from a Silverlight 4 App

by Dave Corun on August 1st, 2010
Assembly assembly = Assembly.GetExecutingAssembly();
String version = assembly.FullName.Split(',')[1];
String fullversion = version.Split('=')[1];

int build = int.Parse(fullversion.Split('.')[2]);
int revision = int.Parse(fullversion.Split('.')[3]);
DateTime buildDate = new DateTime(2000, 1, 1).AddDays(build).AddSeconds(revision * 2);
String fulldate = buildDate.ToLocalTime().ToString(CultureInfo.InvariantCulture);

txtAssemblyVersion.Text = fullversion
    + Environment.NewLine + buildDate.ToShortDateString() + " " + buildDate.ToShortTimeString();

It’s just that easy!

// Dave

From → Development

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS