Within a Silverlight 3.0 application I want to use the AssemblyFileVersion to display the version information of the application. This is not the same as the AssemblyVersion and is typically retrieved in a .NET application using code such as:
var executingAssembly = Assembly.GetExecutingAssembly();
var fileVersionInfo = FileVersionInfo.GetVersionInfo(executingAssembly.Location);
var versionLabel = fileVersionInfo.FileVersion;
Unfortunately Silverlight 3.0 runtime does not include the FileVersionInfo class. Is there an alternative way to access this information?
I found a solution to this in a twitter post by Craig Young (courtesy of Google’s page caching) using Assembly.GetCustomAttributes as follows
Posting this solution for future reference.