@@ -13,53 +13,53 @@ internal static class RuntimeInfo
1313 /// Gets the current runtime.
1414 /// </summary>
1515 /// <returns>A new instance for the current runtime</returns>
16- internal static Runtime GetRuntime ( )
16+ internal static SentryRuntime GetRuntime ( )
1717 {
1818 var runtime = GetFromRuntimeInformation ( ) ;
1919 runtime ??= GetFromMonoRuntime ( ) ;
2020 runtime ??= GetFromEnvironmentVariable ( ) ;
2121 return runtime . WithAdditionalProperties ( ) ;
2222 }
2323
24- internal static Runtime WithAdditionalProperties ( this Runtime runtime )
24+ internal static SentryRuntime WithAdditionalProperties ( this SentryRuntime runtime )
2525 {
2626#if NETFRAMEWORK
2727 GetNetFxInstallationAndVersion ( runtime , out var inst , out var ver ) ;
2828 var version = runtime . Version ?? ver ;
2929 var installation = runtime . FrameworkInstallation ?? inst ;
30- return new Runtime ( runtime . Name , version , installation , runtime . Raw ) ;
30+ return new SentryRuntime ( runtime . Name , version , installation , runtime . Raw ) ;
3131#elif NET5_0_OR_GREATER
3232 var version = runtime . Version ?? GetNetCoreVersion ( runtime ) ;
3333 var identifier = runtime . Identifier ?? GetRuntimeIdentifier ( runtime ) ;
34- return new Runtime ( runtime . Name , version , runtime . Raw , identifier ) ;
34+ return new SentryRuntime ( runtime . Name , version , runtime . Raw , identifier ) ;
3535#else
3636 var version = runtime . Version ?? GetNetCoreVersion ( runtime ) ;
37- return new Runtime ( runtime . Name , version , runtime . Raw ) ;
37+ return new SentryRuntime ( runtime . Name , version , runtime . Raw ) ;
3838#endif
3939 }
4040
41- internal static Runtime ? Parse ( string ? rawRuntimeDescription , string ? name = null )
41+ internal static SentryRuntime ? Parse ( string ? rawRuntimeDescription , string ? name = null )
4242 {
4343 if ( rawRuntimeDescription == null )
4444 {
45- return name == null ? null : new Runtime ( name ) ;
45+ return name == null ? null : new SentryRuntime ( name ) ;
4646 }
4747
4848 var match = RuntimeParseRegex . Match ( rawRuntimeDescription ) ;
4949 if ( match . Success )
5050 {
51- return new Runtime (
51+ return new SentryRuntime (
5252 name ?? ( match . Groups [ "name" ] . Value == string . Empty ? null : match . Groups [ "name" ] . Value . Trim ( ) ) ,
5353 match . Groups [ "version" ] . Value == string . Empty ? null : match . Groups [ "version" ] . Value . Trim ( ) ,
5454 raw : rawRuntimeDescription ) ;
5555 }
5656
57- return new Runtime ( name , raw : rawRuntimeDescription ) ;
57+ return new SentryRuntime ( name , raw : rawRuntimeDescription ) ;
5858 }
5959
6060#if NETFRAMEWORK
6161 internal static void GetNetFxInstallationAndVersion (
62- Runtime runtime ,
62+ SentryRuntime runtime ,
6363 out FrameworkInstallation ? frameworkInstallation ,
6464 out string ? version )
6565 {
@@ -85,7 +85,7 @@ internal static void GetNetFxInstallationAndVersion(
8585 }
8686 }
8787#else
88- private static string ? GetNetCoreVersion ( Runtime runtime )
88+ private static string ? GetNetCoreVersion ( SentryRuntime runtime )
8989 {
9090 var description = RuntimeInformation . FrameworkDescription ;
9191 return RemovePrefixOrNull ( description , ".NET Core" )
@@ -101,7 +101,7 @@ internal static void GetNetFxInstallationAndVersion(
101101#endif
102102
103103#if NET5_0_OR_GREATER
104- internal static string ? GetRuntimeIdentifier ( Runtime runtime )
104+ internal static string ? GetRuntimeIdentifier ( SentryRuntime runtime )
105105 {
106106 try
107107 {
@@ -114,7 +114,7 @@ internal static void GetNetFxInstallationAndVersion(
114114 }
115115#endif
116116
117- private static Runtime ? GetFromRuntimeInformation ( )
117+ private static SentryRuntime ? GetFromRuntimeInformation ( )
118118 {
119119 try
120120 {
@@ -132,7 +132,7 @@ internal static void GetNetFxInstallationAndVersion(
132132 }
133133 }
134134
135- private static Runtime ? GetFromMonoRuntime ( )
135+ private static SentryRuntime ? GetFromMonoRuntime ( )
136136 => Type . GetType ( "Mono.Runtime" , false )
137137 ? . GetMethod ( "GetDisplayName" , BindingFlags . NonPublic | BindingFlags . Static )
138138 ? . Invoke ( null , null ) is string monoVersion
@@ -146,7 +146,7 @@ internal static void GetNetFxInstallationAndVersion(
146146 : null ;
147147
148148 // This should really only be used on .NET 1.0, 1.1, 2.0, 3.0, 3.5 and 4.0
149- private static Runtime GetFromEnvironmentVariable ( )
149+ private static SentryRuntime GetFromEnvironmentVariable ( )
150150 {
151151 // Environment.Version: NET Framework 4, 4.5, 4.5.1, 4.5.2 = 4.0.30319.xxxxx
152152 // .NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 = 4.0.30319.42000
@@ -158,6 +158,6 @@ private static Runtime GetFromEnvironmentVariable()
158158 1 => "" ,
159159 _ => version . ToString ( )
160160 } ;
161- return new Runtime ( ".NET Framework" , friendlyVersion , raw : "Environment.Version=" + version ) ;
161+ return new SentryRuntime ( ".NET Framework" , friendlyVersion , raw : "Environment.Version=" + version ) ;
162162 }
163163}
0 commit comments