Skip to content

Commit 317f332

Browse files
doeriglukebakken
andauthored
Read VersionString from AssemblyInformationalVersionAttribute (#365) (#368)
Co-authored-by: Martin Dörig <[email protected]> Co-authored-by: Luke Bakken <[email protected]>
1 parent 906eb83 commit 317f332

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

RabbitMQ.Stream.Client/Version.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// 2.0, and the Mozilla Public License, version 2.0.
33
// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
44

5-
using System.Diagnostics;
65
using System.Reflection;
76

87
namespace RabbitMQ.Stream.Client
@@ -11,9 +10,8 @@ public static class Version
1110
{
1211
static Version()
1312
{
14-
var a = Assembly.GetAssembly(typeof(Version));
15-
var fvi = FileVersionInfo.GetVersionInfo(a.Location);
16-
VersionString = fvi.ProductVersion;
13+
var attr = typeof(Version).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
14+
VersionString = attr?.InformationalVersion;
1715
}
1816

1917
public static string VersionString { get; }

0 commit comments

Comments
 (0)