Skip to content

Commit

Permalink
Read VersionString from AssemblyInformationalVersionAttribute (#365) (#…
Browse files Browse the repository at this point in the history
…368)

Co-authored-by: Martin Dörig <martin.doerig@protecdata.ch>
Co-authored-by: Luke Bakken <luke@bakken.io>
  • Loading branch information
3 people authored Mar 19, 2024
1 parent 906eb83 commit 317f332
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions RabbitMQ.Stream.Client/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 2.0, and the Mozilla Public License, version 2.0.
// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

using System.Diagnostics;
using System.Reflection;

namespace RabbitMQ.Stream.Client
Expand All @@ -11,9 +10,8 @@ public static class Version
{
static Version()
{
var a = Assembly.GetAssembly(typeof(Version));
var fvi = FileVersionInfo.GetVersionInfo(a.Location);
VersionString = fvi.ProductVersion;
var attr = typeof(Version).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
VersionString = attr?.InformationalVersion;
}

public static string VersionString { get; }
Expand Down

0 comments on commit 317f332

Please sign in to comment.