Skip to content

Instantly share code, notes, and snippets.

@kaa
Created October 19, 2012 08:07
Show Gist options
  • Save kaa/3916866 to your computer and use it in GitHub Desktop.
Save kaa/3916866 to your computer and use it in GitHub Desktop.
Extension method to extract informational version string from assembly metadata
public static class AssemblyInformationalVersionExtensions {
public static string GetInformationalVersionString(this Assembly assembly) {
return assembly
.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false)
.Cast<AssemblyInformationalVersionAttribute>()
.Select(t=>t.InformationalVersion)
.FirstOrDefault();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment