mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-14 04:58:33 +00:00
feat: Adding extension method for getting assembly informational version
This commit is contained in:
parent
9e715d3790
commit
d587b794cb
2 changed files with 18 additions and 0 deletions
|
|
@ -3,3 +3,8 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
### Added
|
||||||
|
- Adding extension method for getting Informational Version from an Assembly
|
||||||
|
|
||||||
|
|
@ -57,5 +57,18 @@ namespace ICD.Common.Utils.Extensions
|
||||||
string path = extends.GetPath();
|
string path = extends.GetPath();
|
||||||
return path == null ? DateTime.MinValue : IcdFile.GetCreationTime(path);
|
return path == null ? DateTime.MinValue : IcdFile.GetCreationTime(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the informational version for the given assembly.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="extends"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetInformationalVersion(this Assembly extends)
|
||||||
|
{
|
||||||
|
if (extends == null)
|
||||||
|
throw new ArgumentNullException("extends");
|
||||||
|
|
||||||
|
return extends.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue