I'm trying to get the assembly file verison within a Silverlight application. Since Silverlight doesn't have the FileVersionInfo class, this seems to be the recommended way to get the information:
var executingAssembly = Assembly.GetExecutingAssembly();
var customAttributes = executingAssembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false);
if (customAttributes != null)
{
var assemblyFileVersionAttribute = customAttributes[0] as AssemblyFileVersionAttribute;
return assemblyFileVersionAttribute.Version;
}
However, the above code returns 1.2.0.*. That is indeed what is in the AssemblyInfo.cs file, but I want the actual file version (without the asterisk) instead of 1.2.0.*. How can I do that?