From 4bc10865f3aa65b85e7801dbdddad4acbaf09bdc Mon Sep 17 00:00:00 2001 From: Bruno Garcia <bruno@brunogarcia.com> Date: Fri, 22 Mar 2024 18:15:32 -0700 Subject: [PATCH 1/2] add net48 without system.reflection.metadata --- src/Sentry/Internal/RandomValuesFactory.cs | 2 +- src/Sentry/Internal/SynchronizedRandomValuesFactory.cs | 2 +- src/Sentry/Sentry.csproj | 4 ++-- src/Sentry/SpanId.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Sentry/Internal/RandomValuesFactory.cs b/src/Sentry/Internal/RandomValuesFactory.cs index 4b14d198da..cf84184667 100644 --- a/src/Sentry/Internal/RandomValuesFactory.cs +++ b/src/Sentry/Internal/RandomValuesFactory.cs @@ -7,7 +7,7 @@ internal abstract class RandomValuesFactory public abstract double NextDouble(); public abstract void NextBytes(byte[] bytes); -#if !(NETSTANDARD2_0 || NET462) +#if !(NETSTANDARD2_0 || NETFRAMEWORK) public abstract void NextBytes(Span<byte> bytes); #endif diff --git a/src/Sentry/Internal/SynchronizedRandomValuesFactory.cs b/src/Sentry/Internal/SynchronizedRandomValuesFactory.cs index 62a76f04f8..28236d3fba 100644 --- a/src/Sentry/Internal/SynchronizedRandomValuesFactory.cs +++ b/src/Sentry/Internal/SynchronizedRandomValuesFactory.cs @@ -17,7 +17,7 @@ internal class SynchronizedRandomValuesFactory : RandomValuesFactory public override double NextDouble() => Random.NextDouble(); public override void NextBytes(byte[] bytes) => Random.NextBytes(bytes); -#if !(NETSTANDARD2_0 || NET462) +#if !(NETSTANDARD2_0 || NETFRAMEWORK) public override void NextBytes(Span<byte> bytes) => Random.NextBytes(bytes); #endif diff --git a/src/Sentry/Sentry.csproj b/src/Sentry/Sentry.csproj index 77d1d4b965..58b661e624 100644 --- a/src/Sentry/Sentry.csproj +++ b/src/Sentry/Sentry.csproj @@ -8,7 +8,7 @@ </PropertyGroup> <PropertyGroup Condition="'$(SolutionName)' != 'Sentry.Unity'"> - <TargetFrameworks>net8.0;net6.0;netstandard2.1;netstandard2.0;net462</TargetFrameworks> + <TargetFrameworks>net8.0;net6.0;netstandard2.1;netstandard2.0;net462;net48</TargetFrameworks> <TargetFrameworks Condition="'$(NO_ANDROID)' == ''">$(TargetFrameworks);net7.0-android;net8.0-android</TargetFrameworks> <TargetFrameworks Condition="'$(NO_IOS)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net7.0-ios;net8.0-ios</TargetFrameworks> <TargetFrameworks Condition="'$(NO_MACCATALYST)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net7.0-maccatalyst;net8.0-maccatalyst</TargetFrameworks> @@ -45,7 +45,7 @@ </ItemGroup> <!-- Ben.Demystifier also needs System.Reflection.Metadata 5.0.0 or higher on all platforms. --> - <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('net4'))"> + <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('net462'))"> <PackageReference Include="System.Reflection.Metadata" Version="5.0.0" /> </ItemGroup> diff --git a/src/Sentry/SpanId.cs b/src/Sentry/SpanId.cs index a4e1062a40..c199c2bfe4 100644 --- a/src/Sentry/SpanId.cs +++ b/src/Sentry/SpanId.cs @@ -48,7 +48,7 @@ namespace Sentry; /// </summary> public static SpanId Create() { -#if NETSTANDARD2_0 || NET462 +#if NETSTANDARD2_0 || NETFRAMEWORK byte[] buf = new byte[8]; #else Span<byte> buf = stackalloc byte[8]; @@ -57,7 +57,7 @@ public static SpanId Create() Random.NextBytes(buf); var random = BitConverter.ToInt64(buf -#if NETSTANDARD2_0 || NET462 +#if NETSTANDARD2_0 || NETFRAMEWORK , 0); #else ); From d8eca51ad7176ece9d2010686e3b1224b8a0f408 Mon Sep 17 00:00:00 2001 From: Bruno Garcia <bruno@brunogarcia.com> Date: Fri, 22 Mar 2024 18:20:24 -0700 Subject: [PATCH 2/2] remove interpservices from net48 --- src/Sentry/Sentry.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry/Sentry.csproj b/src/Sentry/Sentry.csproj index 58b661e624..0cdfe5d791 100644 --- a/src/Sentry/Sentry.csproj +++ b/src/Sentry/Sentry.csproj @@ -71,7 +71,7 @@ On .NET Framework, we need a package reference to System.Runtime.InteropServices.RuntimeInformation. This is used in Sentry.PlatformAbstractions.RuntimeInfo. It's already built-in for all other targets. --> - <ItemGroup Condition="$(TargetFramework.StartsWith('net4'))"> + <ItemGroup Condition="$(TargetFramework.StartsWith('net462'))"> <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" /> </ItemGroup>