Skip to content

Commit e2b1bcf

Browse files
authored
Multi-target net472, netstandard2.0 & net8.0 (#907)
* Multi-target netstandard2.0 & net8.0 * Also target net472
1 parent 3a95501 commit e2b1bcf

File tree

8 files changed

+10175
-3
lines changed

8 files changed

+10175
-3
lines changed

NGitLab/GitLabException.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Net;
4+
#if !NET8_0_OR_GREATER
45
using System.Runtime.Serialization;
6+
#endif
57
using NGitLab.Impl;
68

79
namespace NGitLab;
@@ -26,12 +28,14 @@ public GitLabException(string message, Exception inner)
2628
{
2729
}
2830

31+
#if !NET8_0_OR_GREATER
2932
protected GitLabException(
3033
SerializationInfo info,
3134
StreamingContext context)
3235
: base(info, context)
3336
{
3437
}
38+
#endif
3539

3640
/// <summary>
3741
/// The error code returned from the server.

NGitLab/NGitLab.csproj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netstandard2.0</TargetFramework>
3+
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
4+
<!-- Keep "WebRequest is obsolete" as a warning -->
5+
<WarningsNotAsErrors>$(WarningsNotAsErrors);SYSLIB0014</WarningsNotAsErrors>
46
</PropertyGroup>
57

68
<ItemGroup>
7-
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
89
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
910
<PrivateAssets>all</PrivateAssets>
1011
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1112
</PackageReference>
13+
</ItemGroup>
14+
15+
<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
16+
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
1217
<PackageReference Include="PolySharp" Version="1.15.0">
1318
<PrivateAssets>all</PrivateAssets>
1419
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1520
</PackageReference>
1621
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
1722
<PackageReference Include="System.Text.Json" Version="8.0.5" />
23+
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == 'net472'" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
28+
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
1829
</ItemGroup>
1930

2031
<ItemGroup>
2132
<InternalsVisibleTo Include="NGitLab.Mock" />
2233
<InternalsVisibleTo Include="NGitLab.Tests" />
2334
</ItemGroup>
24-
</Project>
35+
</Project>
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+


NGitLab/PublicAPI/net8.0/PublicAPI.Unshipped.txt

Lines changed: 5077 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+


NGitLab/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt

Lines changed: 5078 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)