From 06ad8d89668768262037e0255c20b200b53980b6 Mon Sep 17 00:00:00 2001 From: Mauro Servienti Date: Wed, 14 Dec 2022 17:47:09 +0100 Subject: [PATCH 1/2] Multi-target .NET 6 and .NET 7 --- ...fContainedWebApplicationFactoryWithHost.cs | 7 ++----- .../ServiceComposer.AspNetCore.Testing.csproj | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/ServiceComposer.AspNetCore.Testing/SelfContainedWebApplicationFactoryWithHost.cs b/src/ServiceComposer.AspNetCore.Testing/SelfContainedWebApplicationFactoryWithHost.cs index 2f09ee3..2035eb5 100644 --- a/src/ServiceComposer.AspNetCore.Testing/SelfContainedWebApplicationFactoryWithHost.cs +++ b/src/ServiceComposer.AspNetCore.Testing/SelfContainedWebApplicationFactoryWithHost.cs @@ -1,6 +1,4 @@ -#if NET5_0 || NETCOREAPP - -using System; +using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Testing; @@ -49,5 +47,4 @@ protected override IHostBuilder CreateHostBuilder() return hostBuilder; } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/ServiceComposer.AspNetCore.Testing/ServiceComposer.AspNetCore.Testing.csproj b/src/ServiceComposer.AspNetCore.Testing/ServiceComposer.AspNetCore.Testing.csproj index 8c2780f..a3e37dd 100644 --- a/src/ServiceComposer.AspNetCore.Testing/ServiceComposer.AspNetCore.Testing.csproj +++ b/src/ServiceComposer.AspNetCore.Testing/ServiceComposer.AspNetCore.Testing.csproj @@ -1,7 +1,7 @@  - net6.0 + net6.0;net7.0 @@ -21,16 +21,23 @@ - + - + - - + + + + + + + + + - + From b0c3517793f849dd5ae1b54201089f607e4517ec Mon Sep 17 00:00:00 2001 From: Mauro Servienti Date: Wed, 14 Dec 2022 18:43:21 +0100 Subject: [PATCH 2/2] Add all required target frameworks --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 850b756..0cfd9f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,9 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v3.0.3 with: - dotnet-version: 6.0.x + dotnet-version: | + 6.0.x + 7.0.x - name: Build run: dotnet build src --configuration Release - name: Tests