Created
October 19, 2012 08:07
-
-
Save kaa/3916866 to your computer and use it in GitHub Desktop.
Extension method to extract informational version string from assembly metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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