Skip to content

Commit 3ce4e50

Browse files
authored
Add fix for ServerError after moving to .NET5 (#9)
1 parent 3b18623 commit 3ce4e50

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434

3535
- run: ./build.sh build -s true
3636
name: Build
37+
- run: ./build.sh test -s true
38+
name: Test
3739
- run: ./build.sh generatepackages -s true
3840
name: Generate local nuget packages
3941
- run: ./build.sh validatepackages -s true

build/scripts/scripts.fsproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="Argu" Version="6.0.0" />
10-
<PackageReference Include="Bullseye" Version="3.3.0" />
9+
<PackageReference Include="Argu" Version="6.1.1" />
10+
<PackageReference Include="Bullseye" Version="3.5.0" />
1111
<PackageReference Include="Proc" Version="0.6.2" />
12-
<PackageReference Include="Fake.Tools.Git" Version="5.15.0" />
12+
<PackageReference Include="Fake.Tools.Git" Version="5.20.3" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/Elastic.Transport/Components/Connection/HttpWebRequestConnection.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
using System.IO.Compression;
1010
using System.Linq;
1111
using System.Net;
12-
using System.Net.Http;
1312
using System.Net.NetworkInformation;
1413
using System.Net.Security;
15-
using System.Text;
1614
using System.Threading;
1715
using System.Threading.Tasks;
1816
using Elastic.Transport.Diagnostics;
@@ -27,7 +25,7 @@ namespace Elastic.Transport
2725
/// </para>
2826
/// <para/>
2927
/// <para>Do NOT use this class directly on .NET Core. <see cref="HttpWebRequest"/> is monkey patched
30-
/// over <see cref="HttpClient"/> and does not reuse its instances of <see cref="HttpClient"/>
28+
/// over HttpClient and does not reuse its instances of HttpClient
3129
/// </para>
3230
/// </summary>
3331
#if DOTNETCORE

src/Elastic.Transport/Configuration/UserAgent.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System;
66
using System.Reflection;
77
using System.Runtime.InteropServices;
8+
using Elastic.Transport.Extensions;
89

910
namespace Elastic.Transport
1011
{

src/Elastic.Transport/Diagnostics/Diagnostic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ internal set
4747

4848

4949
//_source can be null if Default instance
50-
public void Dispose() => _source?.StopActivity(SetEndTime(DateTime.UtcNow), EndState);
50+
protected override void Dispose(bool disposing) => _source?.StopActivity(SetEndTime(DateTime.UtcNow), EndState);
5151
}
5252
}

src/Elastic.Transport/Elastic.Transport.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
</PropertyGroup>
1717
<ItemGroup>
1818

19-
<PackageReference Include="Microsoft.CSharp" Version="4.6.0" />
20-
<PackageReference Include="System.Buffers" Version="4.5.0" />
21-
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.1" />
22-
<PackageReference Include="System.Text.Json" Version="4.7.1" />
19+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
20+
<PackageReference Include="System.Buffers" Version="4.5.1" />
21+
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
22+
<PackageReference Include="System.Text.Json" Version="5.0.0" />
2323

2424
</ItemGroup>
2525

src/Elastic.Transport/Products/Elasticsearch/Failures/ServerError.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace Elastic.Transport.Products.Elasticsearch.Failures
1515
[DataContract]
1616
public class ServerError
1717
{
18-
internal ServerError() { }
18+
/// <inheritdoc cref="ServerError"/>
19+
public ServerError() { }
1920

2021
/// <inheritdoc cref="ServerError"/>
2122
public ServerError(Error error, int? statusCode)

0 commit comments

Comments
 (0)