Skip to content

Simplify target frameworks to netstandard2.0 + net8.0#562

Merged
Jericho merged 4 commits intoJericho:developfrom
jmbryan4:issue-560/simplify-tfms
Mar 3, 2026
Merged

Simplify target frameworks to netstandard2.0 + net8.0#562
Jericho merged 4 commits intoJericho:developfrom
jmbryan4:issue-560/simplify-tfms

Conversation

@jmbryan4
Copy link
Contributor

@jmbryan4 jmbryan4 commented Feb 27, 2026

Summary

Builds on #559. Simplifies TFMs from net48;netstandard2.0;netstandard2.1 down to netstandard2.0;net8.0:

  • Drop net48netstandard2.0 already covers .NET Framework 4.6.1+ consumers
  • Drop netstandard2.1 — dead-end TFM (only .NET Core 3.x supports it without also supporting net5+)
  • Add net8.0 — unlocks modern crypto APIs, better performance, and satisfies all NET5_0_OR_GREATER / NET6_0_OR_GREATER / NET7_0_OR_GREATER directives
  • Update unit test TFMs from net48;net10.0 to net8.0;net10.0
  • Remove dead #if NET48 conditional code in WebhookParserTests.cs

Closes #560

StrongGrid ships net48 + netstandard2.1 only. When a netstandard2.0
consumer references StrongGrid, NuGet falls back to the net48 build,
producing NU1701 warnings and pulling in System.Net.Http 4.2.0.0 which
conflicts with the netstandard2.0 reference assembly version (4.1.2.0).

Add netstandard2.0 to TargetFrameworks so NuGet resolves the correct
build. Widen preprocessor guards in WebhookParser.cs and Public.cs
to cover netstandard2.0. Suppress the transitive NU1701 from
HttpMultipartParser (which itself lacks netstandard2.0) on that TFM.

Include a repro script (repro/repro-netstandard20.sh) that demonstrates
the issue with published 0.114.0 and verifies the fix.
Drop net48 and netstandard2.1 TFMs from the library and replace with
netstandard2.0 + net8.0. netstandard2.0 still covers .NET Framework
4.6.1+ consumers, and net8.0 unlocks modern APIs for all supported
.NET runtimes. Update unit test TFMs from net48;net10.0 to
net8.0;net10.0 and remove now-dead net48 conditional code.
[Fact]
public void ValidateWebhookSignature()
{
var isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
Copy link
Owner

Choose a reason for hiding this comment

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

I disagree with your removal of this code. The intent is to skip this unit test if executed on Linux with full framework. I realize this PR is removing net48 as a target of this library but it doesn't preclude executing unit tests on the full framework which would cause the unit test to fail on Linux.

Copy link
Owner

Choose a reason for hiding this comment

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

In fact, an improvement of my original code would be to replace #elif NET48_OR_GREATER || NETSTANDARD2_1 with #elif NETFRAMEWORK || NETSTANDARD. This would catch any version of the full framework or any net standard version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

…p directive

- Add net48 and net8.0 back to StrongGrid.UnitTests target frameworks (net48;net8.0;net10.0)
- Restore using System.Runtime.InteropServices directive
- Replace NET5_0_OR_GREATER/#error conditional with simpler NETFRAMEWORK||NETSTANDARD form per Jericho’s suggestion
@jmbryan4 jmbryan4 force-pushed the issue-560/simplify-tfms branch from 3f7659a to d197e58 Compare March 2, 2026 17:49
@jmbryan4 jmbryan4 requested a review from Jericho March 2, 2026 20:23
Copy link
Owner

@Jericho Jericho left a comment

Choose a reason for hiding this comment

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

Excellent!

Thank you for your contribution.

@Jericho Jericho merged commit 665caf1 into Jericho:develop Mar 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify target frameworks to netstandard2.0 + net8.0

2 participants