File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,15 @@ public Client(ClientConfiguration clientConfiguration)
4848 _restClient = new RestClient ( clientConfiguration . ApiBase ) ;
4949 _restClient . Timeout = ConnectTimeoutMilliseconds ;
5050
51- Assembly assembly = Assembly . GetExecutingAssembly ( ) ;
52- FileVersionInfo info = FileVersionInfo . GetVersionInfo ( assembly . Location ) ;
53- _libraryVersion = info . FileVersion ;
51+ try
52+ {
53+ // ref Example 1: https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assemblyname.version?view=netframework-4.8#examples
54+ _libraryVersion = typeof ( Client ) . Assembly . GetName ( ) . Version . ToString ( ) ;
55+ } catch ( Exception )
56+ {
57+ _libraryVersion = "Unknown" ;
58+ }
59+
5460
5561 string dotNetVersion = Environment . Version . ToString ( ) ;
5662 if ( dotNetVersion == "4.0.30319.42000" )
You can’t perform that action at this time.
0 commit comments