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 59
59
60
60
using System . Text ;
61
61
using System . Threading ;
62
+ using System . Reflection ;
62
63
63
64
namespace RabbitMQ . Client . Framing . Impl
64
65
{
@@ -106,6 +107,17 @@ public class Connection : IConnection
106
107
private Timer _heartbeatReadTimer ;
107
108
private AutoResetEvent m_heartbeatRead = new AutoResetEvent ( false ) ;
108
109
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
+
109
121
// true if we haven't finished connection negotiation.
110
122
// In this state socket exceptions are treated as fatal connection
111
123
// errors, otherwise as read timeouts
@@ -352,9 +364,6 @@ IProtocol IConnection.Protocol
352
364
353
365
public static IDictionary < string , object > DefaultClientProperties ( )
354
366
{
355
-
356
- string version = "0.0.0.0" ; // assembly.GetName().Version.ToString();
357
- //TODO: Get the rest of this data from the Assembly Attributes
358
367
IDictionary < string , object > table = new Dictionary < string , object > ( ) ;
359
368
table [ "product" ] = Encoding . UTF8 . GetBytes ( "RabbitMQ" ) ;
360
369
table [ "version" ] = Encoding . UTF8 . GetBytes ( version ) ;
You can’t perform that action at this time.
0 commit comments