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

Bump minimum .NET Framework target to 4.6.2. #1666

Closed
SimonCropp opened this issue May 22, 2022 · 4 comments
Closed

Bump minimum .NET Framework target to 4.6.2. #1666

SimonCropp opened this issue May 22, 2022 · 4 comments
Milestone

Comments

@SimonCropp
Copy link
Contributor

so v7 of System.Text.Json drops support for net461 https://www.nuget.org/packages/System.Text.Json/7.0.0-preview.4.22229.4

So i assume we need to change the min target to 462?

@mattjohnsonpint
Copy link
Contributor

Looks like it still is being built for netstandard2.0, so net461 should still work - no?

@SimonCropp
Copy link
Contributor Author

officially yes. in reality no

the caveat is here https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0#select-net-standard-version

image

2 The versions listed here represent the rules that NuGet uses to determine whether a given .NET Standard library is applicable. While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 or higher.

@mattjohnsonpint
Copy link
Contributor

Given that Microsoft recently ended support for .NET Framework 4.6.1 on April 26, 2022, I would be ok bumping that to 4.6.2 at the same time we add a net7.0 target in the next major release.

@mattjohnsonpint mattjohnsonpint added this to the 4.0.0 milestone May 24, 2022
@mattjohnsonpint mattjohnsonpint moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK May 24, 2022
@mattjohnsonpint mattjohnsonpint changed the title What to do with net461 support in net7 Bump minimum .NET Framework target to 4.6.2. May 24, 2022
@mattjohnsonpint
Copy link
Contributor

Thinking this through more over time, I think we need to keep the net461 target. The main reason is that dropping it would go aginst Sentry's stated philosophy:

https://develop.sentry.dev/sdk/philosophy/#compatibility-is-king

Since we would still be offering a netstandard2.0 target, then an app using net461 would get that target installed, potentially opening them up to bugs that we wouldn't be able to resolve.

Also, it doesn't do much for us really. As long as we have to build for netstandard2.0 and any version of .NET Framework, most of the workarounds we have today will need to remain in place.

As for the STJ concern, this is the only place we take a hard dependency.

<!-- Prefer bundled version of System.Text.Json to avoid extra dependencies -->
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) or '$(TargetFramework)' == 'net461'">
<PackageReference Include="System.Text.Json" Version="5.0.2" />
</ItemGroup>

So .NET Framework and .NET Standard targets will use a minimum STJ of 5.0.2, which won't change unless there's a big problem, such as a security vulnerability. Applications can install a newer STJ if they want or need to. Most newer targets (.NET Core 3.0+) will by default get the version of STJ bundled with the runtime (6.x for .NET 6, 7.x for .NET 7, etc.).

Thus there's nothing special we need to do for continued STJ support across all our targets.

If in the future we find that one of our dependencies dropped NET461 and that became an issue, we could always pin NET461 to the dependencies last working version and create a separate NET462 target. But that's not warranted at this time.

Thanks.

@mattjohnsonpint mattjohnsonpint closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2022
Repository owner moved this from Backlog to Done in Mobile & Cross Platform SDK Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants