Getting Version Info from Assembly

Here is a code snippet to get assembly name, assembly version and product version from the executing assembly:

var assembly = Assembly.GetExecutingAssembly();
var assemblyName = assembly.GetName().Name;
var assemblyVersion = assembly.GetName().Version.ToString();
var productVersion = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion;

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.