Monday, January 04, 2010

Silverlight 3 How to display the version number of my silverlight assembly

On the About page of my silverlight 3 app I wanted to display the version number of the silverlight assembly (not of the web application).

In the Silverlight forums I found a simple solution by PBROMBERG:
Assuming that the xaml page contains a textblock txtVersion with no text.

Assembly asm = Assembly.GetExecutingAssembly();
string[] parts = asm.FullName.Split(',');
txtVersion.Text = parts[1];

the resulting version info will be displayed like:
Version=1.0.2.0

No comments: