Skip to content

Commit e8070ec

Browse files
committed
merge
1 parent 52cb320 commit e8070ec

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

projects/client/RabbitMQ.Client/src/client/impl/Connection.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
using System.Text;
6161
using System.Threading;
62+
using System.Reflection;
6263

6364
namespace RabbitMQ.Client.Framing.Impl
6465
{
@@ -106,6 +107,17 @@ public class Connection : IConnection
106107
private Timer _heartbeatReadTimer;
107108
private AutoResetEvent m_heartbeatRead = new AutoResetEvent(false);
108109

110+
#if CORECLR
111+
private static string version = typeof(Connection).GetTypeInfo().Assembly
112+
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
113+
.InformationalVersion;
114+
#else
115+
private static string version = typeof(Connection).Assembly
116+
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
117+
.InformationalVersion;
118+
#endif
119+
120+
109121
// true if we haven't finished connection negotiation.
110122
// In this state socket exceptions are treated as fatal connection
111123
// errors, otherwise as read timeouts
@@ -352,9 +364,6 @@ IProtocol IConnection.Protocol
352364

353365
public static IDictionary<string, object> DefaultClientProperties()
354366
{
355-
356-
string version = "0.0.0.0";// assembly.GetName().Version.ToString();
357-
//TODO: Get the rest of this data from the Assembly Attributes
358367
IDictionary<string, object> table = new Dictionary<string, object>();
359368
table["product"] = Encoding.UTF8.GetBytes("RabbitMQ");
360369
table["version"] = Encoding.UTF8.GetBytes(version);

0 commit comments

Comments
 (0)