diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index 870264f40..e4c061428 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['6.0', '7.0'] + dotnet-version: ['6.0', '7.0', '8.0'] include: - dotnet-version: '6.0' display-name: '.NET 6.0' @@ -31,6 +31,11 @@ jobs: framework: 'net7' prefix: 'net7' install-version: '7.0.x' + - dotnet-version: '8.0' + display-name: '.NET 8.0' + framework: 'net8' + prefix: 'net8' + install-version: '8.0.x' env: NUPKG_OUTDIR: bin/Release/nugets GOVER: 1.20.3 @@ -101,11 +106,11 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ matrix.install-version }} - - name: Setup .NET 7.0 # net7 is always required. + - name: Setup .NET 8.0 # net8 is always required. uses: actions/setup-dotnet@v1 - if: ${{ matrix.install-version != '7.0.x' }} + if: ${{ matrix.install-version != '8.0.x' }} with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build # disable deterministic builds, just for test run. Deterministic builds break coverage for some reason run: dotnet build --configuration release /p:GITHUB_ACTIONS=false diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index 1c4e1a60e..4fde80610 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -26,7 +26,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build run: dotnet build --configuration release - name: Generate Packages @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['6.0', '7.0'] + dotnet-version: ['6.0', '7.0', '8.0'] include: - dotnet-version: '6.0' install-3: false @@ -56,6 +56,12 @@ jobs: framework: 'net7' prefix: 'net7' install-version: '7.0.x' + - dotnet-version: '8.0' + install-3: false + display-name: '.NET 8.0' + framework: 'net8' + prefix: 'net8' + install-version: '8.0.x' steps: - uses: actions/checkout@v1 - name: Parse release version @@ -64,11 +70,11 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ matrix.install-version }} - - name: Setup .NET 7.0 # net7 is always required. + - name: Setup .NET 8.0 # net8 is always required. uses: actions/setup-dotnet@v1 - if: ${{ matrix.install-version != '7.0.x' }} + if: ${{ matrix.install-version != '8.0.x' }} with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Build # disable deterministic builds, just for test run. Deterministic builds break coverage for some reason run: dotnet build --configuration release /p:GITHUB_ACTIONS=false diff --git a/src/Dapr.Actors.AspNetCore/ActorsEndpointRouteBuilderExtensions.cs b/src/Dapr.Actors.AspNetCore/ActorsEndpointRouteBuilderExtensions.cs index e7937bbbf..55d161d9a 100644 --- a/src/Dapr.Actors.AspNetCore/ActorsEndpointRouteBuilderExtensions.cs +++ b/src/Dapr.Actors.AspNetCore/ActorsEndpointRouteBuilderExtensions.cs @@ -109,7 +109,7 @@ private static IEndpointConventionBuilder MapActorMethodEndpoint(this IEndpointR if (header != string.Empty) { // exception case - context.Response.Headers.Add(Constants.ErrorResponseHeaderName, header); // add error header + context.Response.Headers[Constants.ErrorResponseHeaderName] = header; // add error header } await context.Response.Body.WriteAsync(body, 0, body.Length); // add response message body @@ -118,7 +118,7 @@ private static IEndpointConventionBuilder MapActorMethodEndpoint(this IEndpointR { var (header, body) = CreateExceptionResponseMessage(ex); - context.Response.Headers.Add(Constants.ErrorResponseHeaderName, header); + context.Response.Headers[Constants.ErrorResponseHeaderName] = header; await context.Response.Body.WriteAsync(body, 0, body.Length); } finally diff --git a/src/Dapr.Actors.AspNetCore/Dapr.Actors.AspNetCore.csproj b/src/Dapr.Actors.AspNetCore/Dapr.Actors.AspNetCore.csproj index cfd7d8123..1114b7828 100644 --- a/src/Dapr.Actors.AspNetCore/Dapr.Actors.AspNetCore.csproj +++ b/src/Dapr.Actors.AspNetCore/Dapr.Actors.AspNetCore.csproj @@ -1,7 +1,4 @@  - - net6 - This package contains the reference assemblies for developing Actor services using Dapr. diff --git a/src/Dapr.AspNetCore/Dapr.AspNetCore.csproj b/src/Dapr.AspNetCore/Dapr.AspNetCore.csproj index a50133677..c61fc5abc 100644 --- a/src/Dapr.AspNetCore/Dapr.AspNetCore.csproj +++ b/src/Dapr.AspNetCore/Dapr.AspNetCore.csproj @@ -1,9 +1,5 @@  - - net6 - - This package contains the reference assemblies for developing services using Dapr and AspNetCore. diff --git a/src/Dapr.AspNetCore/DaprAuthenticationHandler.cs b/src/Dapr.AspNetCore/DaprAuthenticationHandler.cs index 822694c3b..dc21b5926 100644 --- a/src/Dapr.AspNetCore/DaprAuthenticationHandler.cs +++ b/src/Dapr.AspNetCore/DaprAuthenticationHandler.cs @@ -25,6 +25,14 @@ internal class DaprAuthenticationHandler : AuthenticationHandler options, + ILoggerFactory logger, + UrlEncoder encoder) : base(options, logger, encoder) + { + } +#else public DaprAuthenticationHandler( IOptionsMonitor options, ILoggerFactory logger, @@ -32,6 +40,7 @@ public DaprAuthenticationHandler( ISystemClock clock) : base(options, logger, encoder, clock) { } +#endif protected override Task HandleAuthenticateAsync() { diff --git a/src/Dapr.Client/Dapr.Client.csproj b/src/Dapr.Client/Dapr.Client.csproj index 45dd168fe..a3fd5b082 100644 --- a/src/Dapr.Client/Dapr.Client.csproj +++ b/src/Dapr.Client/Dapr.Client.csproj @@ -1,9 +1,5 @@  - - net6 - - diff --git a/src/Dapr.Client/DaprApiException.cs b/src/Dapr.Client/DaprApiException.cs index e7af8947c..75fc2cf7f 100644 --- a/src/Dapr.Client/DaprApiException.cs +++ b/src/Dapr.Client/DaprApiException.cs @@ -92,6 +92,9 @@ public DaprApiException(string message, Exception inner, string errorCode, bool /// /// The object that contains serialized object data of the exception being thrown. /// The object that contains contextual information about the source or destination. The context parameter is reserved for future use and can be null. +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // add this attribute to the serialization ctor +#endif protected DaprApiException(SerializationInfo info, StreamingContext context) : base(info, context) { @@ -115,6 +118,9 @@ protected DaprApiException(SerializationInfo info, StreamingContext context) public bool IsTransient { get; } = false; /// +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // add this attribute to GetObjectData +#endif public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/src/Dapr.Client/DaprException.cs b/src/Dapr.Client/DaprException.cs index 8c94a452d..e7b1efaba 100644 --- a/src/Dapr.Client/DaprException.cs +++ b/src/Dapr.Client/DaprException.cs @@ -47,6 +47,9 @@ public DaprException(string message, Exception innerException) /// /// The object that contains serialized object data of the exception being thrown. /// The object that contains contextual information about the source or destination. The context parameter is reserved for future use and can be null. +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] // add this attribute to GetObjectData +#endif protected DaprException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/src/Dapr.Extensions.Configuration/Dapr.Extensions.Configuration.csproj b/src/Dapr.Extensions.Configuration/Dapr.Extensions.Configuration.csproj index 0f1f64048..71fd0153e 100644 --- a/src/Dapr.Extensions.Configuration/Dapr.Extensions.Configuration.csproj +++ b/src/Dapr.Extensions.Configuration/Dapr.Extensions.Configuration.csproj @@ -1,7 +1,6 @@ - net6 enable diff --git a/src/Dapr.Workflow/Dapr.Workflow.csproj b/src/Dapr.Workflow/Dapr.Workflow.csproj index ef9722d36..d5820deb1 100644 --- a/src/Dapr.Workflow/Dapr.Workflow.csproj +++ b/src/Dapr.Workflow/Dapr.Workflow.csproj @@ -2,7 +2,8 @@ - net6;net7 + + net6;net7;net8 enable Dapr.Workflow Dapr Workflow Authoring SDK diff --git a/src/Directory.Build.props b/src/Directory.Build.props index cdfef31a6..2794f1b1f 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,6 +3,7 @@ + net6;net8 $(RepoRoot)bin\$(Configuration)\prod\$(MSBuildProjectName)\ $(OutputPath)$(MSBuildProjectName).xml diff --git a/test/Dapr.Actors.AspNetCore.IntegrationTest.App/Dapr.Actors.AspNetCore.IntegrationTest.App.csproj b/test/Dapr.Actors.AspNetCore.IntegrationTest.App/Dapr.Actors.AspNetCore.IntegrationTest.App.csproj index af0bfa13e..c06d651f4 100644 --- a/test/Dapr.Actors.AspNetCore.IntegrationTest.App/Dapr.Actors.AspNetCore.IntegrationTest.App.csproj +++ b/test/Dapr.Actors.AspNetCore.IntegrationTest.App/Dapr.Actors.AspNetCore.IntegrationTest.App.csproj @@ -1,9 +1,5 @@ - - net6;net7 - - diff --git a/test/Dapr.Actors.AspNetCore.IntegrationTest/Dapr.Actors.AspNetCore.IntegrationTest.csproj b/test/Dapr.Actors.AspNetCore.IntegrationTest/Dapr.Actors.AspNetCore.IntegrationTest.csproj index 1b8590d7e..deccfc1e6 100644 --- a/test/Dapr.Actors.AspNetCore.IntegrationTest/Dapr.Actors.AspNetCore.IntegrationTest.csproj +++ b/test/Dapr.Actors.AspNetCore.IntegrationTest/Dapr.Actors.AspNetCore.IntegrationTest.csproj @@ -1,8 +1,4 @@ - - net6;net7 - - runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/Dapr.Actors.AspNetCore.Test/Dapr.Actors.AspNetCore.Test.csproj b/test/Dapr.Actors.AspNetCore.Test/Dapr.Actors.AspNetCore.Test.csproj index 962963ac2..7e352d007 100644 --- a/test/Dapr.Actors.AspNetCore.Test/Dapr.Actors.AspNetCore.Test.csproj +++ b/test/Dapr.Actors.AspNetCore.Test/Dapr.Actors.AspNetCore.Test.csproj @@ -1,7 +1,6 @@ - net6;net7 Dapr.Actors.AspNetCore diff --git a/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj b/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj index 8a0fa16d7..8852dd465 100644 --- a/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj +++ b/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj @@ -1,6 +1,5 @@  - net6;net7 Dapr.Actors $(DefineConstants);ACTORS diff --git a/test/Dapr.AspNetCore.IntegrationTest.App/Dapr.AspNetCore.IntegrationTest.App.csproj b/test/Dapr.AspNetCore.IntegrationTest.App/Dapr.AspNetCore.IntegrationTest.App.csproj index 0e15b6855..f415639be 100644 --- a/test/Dapr.AspNetCore.IntegrationTest.App/Dapr.AspNetCore.IntegrationTest.App.csproj +++ b/test/Dapr.AspNetCore.IntegrationTest.App/Dapr.AspNetCore.IntegrationTest.App.csproj @@ -1,9 +1,5 @@  - - net6;net7 - - diff --git a/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj b/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj index c3cfd2cbf..3cd79d908 100644 --- a/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj +++ b/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj @@ -1,7 +1,4 @@  - - net6;net7 - diff --git a/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj b/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj index 27f11a308..aa463be98 100644 --- a/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj +++ b/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj @@ -1,7 +1,4 @@  - - net6;net7 - diff --git a/test/Dapr.Client.Test/Dapr.Client.Test.csproj b/test/Dapr.Client.Test/Dapr.Client.Test.csproj index c6de11e31..aef5b4113 100644 --- a/test/Dapr.Client.Test/Dapr.Client.Test.csproj +++ b/test/Dapr.Client.Test/Dapr.Client.Test.csproj @@ -1,7 +1,4 @@  - - net6;net7 - diff --git a/test/Dapr.E2E.Test.Actors/Dapr.E2E.Test.Actors.csproj b/test/Dapr.E2E.Test.Actors/Dapr.E2E.Test.Actors.csproj index 0455d6db4..56ab3d222 100644 --- a/test/Dapr.E2E.Test.Actors/Dapr.E2E.Test.Actors.csproj +++ b/test/Dapr.E2E.Test.Actors/Dapr.E2E.Test.Actors.csproj @@ -1,9 +1,5 @@ - - net6;net7 - - diff --git a/test/Dapr.E2E.Test.App.Grpc/Dapr.E2E.Test.App.Grpc.csproj b/test/Dapr.E2E.Test.App.Grpc/Dapr.E2E.Test.App.Grpc.csproj index 8dcf009bc..849870b98 100644 --- a/test/Dapr.E2E.Test.App.Grpc/Dapr.E2E.Test.App.Grpc.csproj +++ b/test/Dapr.E2E.Test.App.Grpc/Dapr.E2E.Test.App.Grpc.csproj @@ -1,7 +1,4 @@ - - net6;net7 - diff --git a/test/Dapr.E2E.Test.App.ReentrantActor/Dapr.E2E.Test.App.ReentrantActors.csproj b/test/Dapr.E2E.Test.App.ReentrantActor/Dapr.E2E.Test.App.ReentrantActors.csproj index dd087aef1..2fda3becc 100644 --- a/test/Dapr.E2E.Test.App.ReentrantActor/Dapr.E2E.Test.App.ReentrantActors.csproj +++ b/test/Dapr.E2E.Test.App.ReentrantActor/Dapr.E2E.Test.App.ReentrantActors.csproj @@ -1,9 +1,5 @@ - - net6;net7 - - diff --git a/test/Dapr.E2E.Test.App/Dapr.E2E.Test.App.csproj b/test/Dapr.E2E.Test.App/Dapr.E2E.Test.App.csproj index 5c81557b8..e6ad11456 100644 --- a/test/Dapr.E2E.Test.App/Dapr.E2E.Test.App.csproj +++ b/test/Dapr.E2E.Test.App/Dapr.E2E.Test.App.csproj @@ -1,9 +1,5 @@ - - net6;net7 - - diff --git a/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj b/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj index 8b1448759..f899167c4 100644 --- a/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj +++ b/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj @@ -1,7 +1,4 @@  - - net6;net7 - diff --git a/test/Dapr.E2E.Test/DaprTestApp.cs b/test/Dapr.E2E.Test/DaprTestApp.cs index d65e21fd6..83f9948ac 100644 --- a/test/Dapr.E2E.Test/DaprTestApp.cs +++ b/test/Dapr.E2E.Test/DaprTestApp.cs @@ -132,16 +132,14 @@ public void Stop() private static string GetTargetFrameworkName() { var targetFrameworkName = ((TargetFrameworkAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(TargetFrameworkAttribute), false).FirstOrDefault()).FrameworkName; - string frameworkMoniker; - if (targetFrameworkName == ".NETCoreApp,Version=v6.0") - { - frameworkMoniker = "net6"; - } - else + + return targetFrameworkName switch { - frameworkMoniker = "net7"; - } - return frameworkMoniker; + ".NETCoreApp,Version=v6.0" => "net6", + ".NETCoreApp,Version=v7.0" => "net7", + ".NETCoreApp,Version=v8.0" => "net8", + _ => throw new InvalidOperationException($"Unsupported target framework: {targetFrameworkName}") + }; } private static (int, int, int, int) GetFreePorts() diff --git a/test/Dapr.Extensions.Configuration.Test/Dapr.Extensions.Configuration.Test.csproj b/test/Dapr.Extensions.Configuration.Test/Dapr.Extensions.Configuration.Test.csproj index 0cd57ca67..2e4523582 100644 --- a/test/Dapr.Extensions.Configuration.Test/Dapr.Extensions.Configuration.Test.csproj +++ b/test/Dapr.Extensions.Configuration.Test/Dapr.Extensions.Configuration.Test.csproj @@ -1,7 +1,4 @@  - - net6;net7 - diff --git a/test/Directory.Build.props b/test/Directory.Build.props index e7d30ea2d..0ce23c19e 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,6 +2,8 @@ + net6;net7;net8 + $(RepoRoot)bin\$(Configuration)\test\$(MSBuildProjectName)\