diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4c49f00..32c4868 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ jobs: - name: install dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: install packages run: dotnet restore diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d4b891c..8ef7630 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -21,7 +21,7 @@ jobs: - name: install dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: install packages run: dotnet restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb6d889..471e70f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: install dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: build run: dotnet build diff --git a/src/Byndyusoft.Net.Http.MessagePack.csproj b/src/Byndyusoft.Net.Http.MessagePack.csproj index 5290091..a2c4695 100644 --- a/src/Byndyusoft.Net.Http.MessagePack.csproj +++ b/src/Byndyusoft.Net.Http.MessagePack.csproj @@ -1,8 +1,8 @@ - + true - netstandard2.0;net6.0 + netstandard2.0;net8.0 icon.png MIT System.Net.Http.MessagePack @@ -18,7 +18,7 @@ System.Net.Http.MessagePack.Formatting.MessagePackMediaTypeFormatter Byndyusoft;Net;Http;MessagePack - 0.5.4 + 0.6.0 Byndyusoft https://github.com/Byndyusoft/Byndyusoft.Net.Http.MessagePack git diff --git a/src/HttpContentMessagePackExtensions.cs b/src/HttpContentMessagePackExtensions.cs index 049eb50..a886360 100644 --- a/src/HttpContentMessagePackExtensions.cs +++ b/src/HttpContentMessagePackExtensions.cs @@ -30,7 +30,11 @@ public static class HttpContentMessagePackExtensions if (content is ObjectContent objectContent) return objectContent.Value; var formatter = new MessagePackMediaTypeFormatter(options); +#if NET5_0_OR_GREATER + await using var readStream = await content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); +#else using var readStream = await content.ReadAsStreamAsync().ConfigureAwait(false); +#endif return await formatter.ReadFromStreamAsync(type, readStream, content, null, cancellationToken) .ConfigureAwait(false); } diff --git a/tests/Byndyusoft.Net.Http.MessagePack.Tests.csproj b/tests/Byndyusoft.Net.Http.MessagePack.Tests.csproj index 0dc480a..51da552 100644 --- a/tests/Byndyusoft.Net.Http.MessagePack.Tests.csproj +++ b/tests/Byndyusoft.Net.Http.MessagePack.Tests.csproj @@ -1,7 +1,7 @@ - + - net6.0 + net8.0 System.Net.Http.Tests false InProcess @@ -11,13 +11,13 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all