File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
src/ServiceControl.RavenDB Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 99 <PackageReference Include =" ByteSize" />
1010 <PackageReference Include =" Microsoft.Extensions.Hosting.Abstractions" />
1111 <PackageReference Include =" NServiceBus" />
12- <PackageReference Include =" NuGet.Versioning" />
1312 <PackageReference Include =" RavenDB.Embedded" />
1413 </ItemGroup >
1514
Original file line number Diff line number Diff line change 22{
33 using System . Reflection ;
44 using System . Threading ;
5- using NuGet . Versioning ;
65 using Raven . Client . Documents ;
76 using Raven . Client . ServerWide . Operations ;
87
@@ -11,17 +10,16 @@ public static class StartupChecks
1110 public static async Task EnsureServerVersion ( IDocumentStore store , CancellationToken cancellationToken = default )
1211 {
1312 var build = await store . Maintenance . Server . SendAsync ( new GetBuildNumberOperation ( ) , cancellationToken ) ;
13+ var serverProductVersion = new Version ( build . ProductVersion ) ;
1414
15- var clientVersion = SemanticVersion . Parse ( typeof ( Raven . Client . Constants ) . Assembly . GetCustomAttributes < AssemblyInformationalVersionAttribute > ( ) . First ( ) . InformationalVersion ) ;
16- var serverVersion = NuGetVersion . Parse ( build . ProductVersion ) ;
15+ var clientVersion = typeof ( Raven . Client . Constants ) . Assembly . GetCustomAttributes < AssemblyInformationalVersionAttribute > ( ) . First ( ) . InformationalVersion ;
16+ var parts = clientVersion . Split ( '.' ) ;
17+ var clientProductVersion = new Version ( $ "{ parts [ 0 ] } .{ parts [ 1 ] } ") ;
1718
18- var serverHasLowerMajorMinor = serverVersion . Major < clientVersion . Major
19- || ( serverVersion . Major == clientVersion . Major && serverVersion . Minor < clientVersion . Minor ) ;
20-
21- if ( serverHasLowerMajorMinor )
19+ if ( clientProductVersion > serverProductVersion )
2220 {
23- throw new Exception ( $ "ServiceControl expects at minimum RavenDB Server version { clientVersion . Major } . { clientVersion . Minor } but the server is using { build . ProductVersion } .") ;
21+ throw new Exception ( $ "ServiceControl expects RavenDB Server version { clientProductVersion } or higher, but the server is using { serverProductVersion } .") ;
2422 }
2523 }
2624 }
27- }
25+ }
You can’t perform that action at this time.
0 commit comments