File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
projects/client/RabbitMQ.Client/src/client/impl Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 5959
6060using System . Text ;
6161using System . Threading ;
62+ using System . Reflection ;
6263
6364namespace 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 ) ;
You can’t perform that action at this time.
0 commit comments