Skip to content

Commit f8b339e

Browse files
Remove special case Newtonsoft version, and update TargetFrameworks (#2992)
* removed Newtonsoft reference from net8.0 targeted item group * added net7.0 and net8.0 into target frameworks to ensure dotnet build builds for those targets suppressed an obsolete warning in net8.0 (safe for now, will take care of later) * updated StripeNetTargetFramework string building in SystemNetHttpClient * added empty line to appease the style cop --------- Co-authored-by: Ramya Rao <[email protected]>
1 parent ad87550 commit f8b339e

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,12 @@ internal static JsonSerializerSettings DefaultSerializerSettings(ApiRequestor re
214214
{
215215
return new JsonSerializerSettings
216216
{
217+
// Disable the warning (applies to net8.0).
218+
#pragma warning disable SYSLIB0050
217219
Context = new StreamingContext(StreamingContextStates.All, new DeserializationContext { Requestor = requestor }),
220+
221+
// Re-enable the warning.
222+
#pragma warning restore SYSLIB0050
218223
Converters = new List<JsonConverter>
219224
{
220225
new StripeObjectConverter(),

src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ public class SystemNetHttpClient : IHttpClient
2828
#if NET5_0
2929
"net5.0"
3030
#elif NET6_0
31-
"net6.0"
31+
"net6.0"
32+
#elif NET7_0
33+
"net7.0"
34+
#elif NET8_0
35+
"net8.0"
3236
#elif NETCOREAPP3_1
33-
"netcoreapp3.1"
37+
"netcoreapp3.1"
3438
#elif NETSTANDARD2_0
3539
"netstandard2.0"
3640
#elif NET461

src/Stripe.net/Stripe.net.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Version>46.0.0</Version>
66
<LangVersion>8</LangVersion>
77
<Authors>Stripe, Jayme Davis</Authors>
8-
<TargetFrameworks>net5.0;net6.0;netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
8+
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0;netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
99
<PackageTags>stripe;payment;credit;cards;money;gateway;paypal;braintree</PackageTags>
1010
<PackageIcon>icon.png</PackageIcon>
1111
<PackageProjectUrl>https://github.com/stripe/stripe-dotnet</PackageProjectUrl>
@@ -53,7 +53,6 @@
5353
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
5454
</ItemGroup>
5555
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
56-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
5756
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
5857
</ItemGroup>
5958

0 commit comments

Comments
 (0)