File tree 1 file changed +14
-7
lines changed
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -356,14 +356,21 @@ private string CheckFor462PlusVersion(int releaseKey)
356
356
357
357
private string GetNetCoreVersion ( )
358
358
{
359
- var assembly = typeof ( System . Runtime . GCSettings ) . GetTypeInfo ( ) . Assembly ;
360
- if ( assembly ? . CodeBase != null )
359
+ try
360
+ {
361
+ var assembly = typeof ( System . Runtime . GCSettings ) . GetTypeInfo ( ) . Assembly ;
362
+ if ( assembly ? . CodeBase != null )
363
+ {
364
+ var assemblyPath = assembly . CodeBase . Split ( new [ ] { '/' , '\\ ' } , StringSplitOptions . RemoveEmptyEntries ) ;
365
+ var netCoreAppIndex = Array . IndexOf ( assemblyPath , "Microsoft.NETCore.App" ) ;
366
+ return netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath . Length - 2 ?
367
+ assemblyPath [ netCoreAppIndex + 1 ] :
368
+ null ;
369
+ }
370
+ }
371
+ catch
361
372
{
362
- var assemblyPath = assembly . CodeBase . Split ( new [ ] { '/' , '\\ ' } , StringSplitOptions . RemoveEmptyEntries ) ;
363
- var netCoreAppIndex = Array . IndexOf ( assemblyPath , "Microsoft.NETCore.App" ) ;
364
- return netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath . Length - 2 ?
365
- assemblyPath [ netCoreAppIndex + 1 ] :
366
- null ;
373
+ return null ;
367
374
}
368
375
369
376
#if NETSTANDARD2_0
You can’t perform that action at this time.
0 commit comments