Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add net48 without system.reflection.metadata #3236

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Sentry/Internal/RandomValuesFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/Internal/SynchronizedRandomValuesFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/Sentry/Sentry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be a new target or to replace the net462 target?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we need to keep supporting the older one, but we can at least improve for apps running on the latest version

<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>
Expand Down Expand Up @@ -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>

Expand All @@ -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>

Expand Down
4 changes: 2 additions & 2 deletions src/Sentry/SpanId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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
);
Expand Down
Loading