コード例 #1
0
 private string GetCommitHash()
 {
     try
     {
         return(AssemblyCommitHashExtractor.ExtractFromAssembly(Assembly.GetAssembly(GetType())));
     }
     catch (Exception)
     {
         return(null);
     }
 }
コード例 #2
0
 public object Query() =>
 AppDomain.CurrentDomain
 .GetAssemblies()
 .Where(assembly => !assembly.IsDynamic)
 .OrderBy(assembly => assembly.GetName().Name, StringComparer.OrdinalIgnoreCase)
 .Select(assembly => new
 {
     assembly.GetName().Name,
     assembly.GetName().Version,
     CommitHash     = AssemblyCommitHashExtractor.ExtractFromAssembly(assembly),
     BuildTimestamp = AssemblyBuildTimeExtractor.ExtractFromAssembly(assembly)?.ToString("u")
 })
 .ToArray();
コード例 #3
0
 public static void ExtractFromAssembly_by_path_should_be_not_null_or_empty()
 => string.IsNullOrEmpty(
     AssemblyCommitHashExtractor.ExtractFromAssembly(
         Assembly.GetAssembly(typeof(AssemblyCommitHashExtractor)).Location))
 .Should()
 .BeFalse();