Repository: ThreeMammals/Ocelot

Issue:
Ocelot to .NET 8
## Expected Behavior / New Feature
[.NET 8 was launched this week](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8/), so we expect Ocelot to be compatible with .NET 8 as soon as possible.  😸 
- [Announcing .NET 8 | .NET Blog](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8/) by Gaurav Seth on November 14th, 2023

## Actual Behavior / Motivation for New Feature
Only supporting .NET 7

## Specifications
- After a chat with @RaynaldM, we should provide .NET8 and .NET7 support for the Ocelot sources (`<TargetFrameworks>` and `Item` groups with conditions)
- After yet another chat with @raman-m we should provide .NET6 support too...
- Tests and examples are targeting .NET8, .NET7 and .NET6 if possible
☕ 🥃 😸 



Hints:

Patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 4a5f1d936..cbdcf7c9d 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,13 +4,13 @@ orbs:
 jobs:
   build:
     docker:
-      - image: mijitt0m/ocelot-build:0.0.9
+      - image: ocelot2/circleci-build:latest
     steps:
       - checkout
       - run: dotnet tool restore && dotnet cake
   release:
     docker:
-      - image: mijitt0m/ocelot-build:0.0.9
+      - image: ocelot2/circleci-build:latest
     steps:
       - checkout
       - run: dotnet tool restore && dotnet cake --target=Release
@@ -19,7 +19,7 @@ workflows:
   main:
     jobs:
       - queue/block_workflow:
-          time: "20"
+          time: '20'
           only-on-branch: main
       - release:
           requires:
@@ -38,6 +38,6 @@ workflows:
       - build:
           filters:
             branches:
-              ignore: 
+              ignore:
                 - main
                 - develop
diff --git a/.editorconfig b/.editorconfig
index 6aa3d30f4..e4e769b52 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -4,7 +4,12 @@ root = true
 end_of_line = lf
 insert_final_newline = true
 
-[*.cs]
+[*.cs]
 end_of_line = lf
 indent_style = space
 indent_size = 4
+
+# XML files
+[*.xml]
+indent_style = space
+indent_size = 2
diff --git a/Ocelot.sln b/Ocelot.sln
index c4abd99a9..1215130de 100644
--- a/Ocelot.sln
+++ b/Ocelot.sln
@@ -1,7 +1,7 @@
-﻿
+
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 17
-VisualStudioVersion = 17.6.33723.286
+VisualStudioVersion = 17.8.34309.116
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5CFB79B7-C9DC-45A4-9A75-625D92471702}"
 EndProject
diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base
index 691339490..49b877c10 100644
--- a/docker/Dockerfile.base
+++ b/docker/Dockerfile.base
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine
+FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine
 
 RUN apk add bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib git openssh-client
 
@@ -6,4 +6,11 @@ RUN curl -L --output ./dotnet-install.sh https://dot.net/v1/dotnet-install.sh
 
 RUN chmod u+x ./dotnet-install.sh 
 
+# Install .NET 8 SDK (already included in the base image, but listed for consistency)
+RUN ./dotnet-install.sh -c 8.0 -i /usr/share/dotnet
+
+# Install .NET 7 SDK
+RUN ./dotnet-install.sh -c 7.0 -i /usr/share/dotnet
+
+# Install .NET 6 SDK
 RUN ./dotnet-install.sh -c 6.0 -i /usr/share/dotnet
diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build
index 5498c6106..39d3107b9 100644
--- a/docker/Dockerfile.build
+++ b/docker/Dockerfile.build
@@ -1,7 +1,8 @@
 # call from ocelot repo root with
 # docker build --platform linux/arm64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build .
 # docker build --platform linux/amd64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build .
-FROM mijitt0m/ocelot-build:0.0.9
+
+FROM ocelot2/circleci-build:latest
 
 ARG OCELOT_COVERALLS_TOKEN
 
@@ -13,4 +14,4 @@ COPY ./. .
 
 RUN dotnet tool restore
 
-RUN	dotnet cake
\ No newline at end of file
+RUN	dotnet cake
diff --git a/docker/Dockerfile.release b/docker/Dockerfile.release
index e2659c035..89c1b3f79 100644
--- a/docker/Dockerfile.release
+++ b/docker/Dockerfile.release
@@ -1,7 +1,8 @@
 # call from ocelot repo root with
 # docker build --platform linux/arm64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN --build-arg OCELOT_GITHUB_API_KEY=$OCELOT_GITHUB_API_KEY --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build .
 # docker build --platform linux/amd64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN --build-arg OCELOT_GITHUB_API_KEY=$OCELOT_GITHUB_API_KEY --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build .
-FROM mijitt0m/ocelot-build:0.0.9
+
+FROM ocelot2/circleci-build:latest
 
 ARG OCELOT_COVERALLS_TOKEN
 ARG OCELOT_NUTGET_API_KEY
@@ -17,4 +18,4 @@ COPY ./. .
 
 RUN dotnet tool restore
 
-RUN	dotnet cake
\ No newline at end of file
+RUN	dotnet cake
diff --git a/docker/README.md b/docker/README.md
index 3eb46aa42..dcecc224d 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -1,3 +1,3 @@
 # docker build
 
-This folder contains the dockerfile and script to create the ocelot build container.
\ No newline at end of file
+This folder contains the `Dockerfile.*` and `build.sh` script to create the Ocelot build image & container.
diff --git a/docker/build.sh b/docker/build.sh
index bf2cee9b5..15d1325ad 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -1,7 +1,11 @@
-# this script build the ocelot docker file
-version=0.0.9
-docker build --platform linux/amd64 -t mijitt0m/ocelot-build -f Dockerfile.base .
+# This script builds the Ocelot Docker file
+
+# {DotNetSdkVer}.{OcelotVer} -> {.NET8}.{21.0} -> 8.21.0
+version=8.21.0
+docker build --platform linux/amd64 -t ocelot2/circleci-build -f Dockerfile.base .
+
 echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
-docker tag mijitt0m/ocelot-build mijitt0m/ocelot-build:$version
-docker push mijitt0m/ocelot-build:latest
-docker push mijitt0m/ocelot-build:$version
\ No newline at end of file
+
+docker tag ocelot2/circleci-build ocelot2/circleci-build:$version
+docker push ocelot2/circleci-build:latest
+docker push ocelot2/circleci-build:$version
diff --git a/samples/AdministrationApi/AdministrationApi.csproj b/samples/AdministrationApi/AdministrationApi.csproj
index 691f6bb63..cd995c774 100644
--- a/samples/AdministrationApi/AdministrationApi.csproj
+++ b/samples/AdministrationApi/AdministrationApi.csproj
@@ -1,6 +1,6 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk.Web">
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
   </PropertyGroup>
@@ -8,8 +8,7 @@
     <Folder Include="wwwroot\" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Ocelot" Version="18.0.0" />
-    <PackageReference Include="Ocelot.Administration" Version="18.0.0" />
-
+    <ProjectReference Include="..\..\src\Ocelot.Administration\Ocelot.Administration.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
   </ItemGroup>
 </Project>
diff --git a/samples/OcelotBasic/Ocelot.Samples.OcelotBasic.ApiGateway.csproj b/samples/OcelotBasic/Ocelot.Samples.OcelotBasic.ApiGateway.csproj
index 41ad8deb6..9e381bb17 100644
--- a/samples/OcelotBasic/Ocelot.Samples.OcelotBasic.ApiGateway.csproj
+++ b/samples/OcelotBasic/Ocelot.Samples.OcelotBasic.ApiGateway.csproj
@@ -1,18 +1,14 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk.Web">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
   </PropertyGroup>
-
   <ItemGroup>
     <Folder Include="Properties\" />
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
   </ItemGroup>
-
 </Project>
diff --git a/samples/OcelotEureka/ApiGateway/ApiGateway.csproj b/samples/OcelotEureka/ApiGateway/ApiGateway.csproj
index 90f81c521..a41f67537 100644
--- a/samples/OcelotEureka/ApiGateway/ApiGateway.csproj
+++ b/samples/OcelotEureka/ApiGateway/ApiGateway.csproj
@@ -1,25 +1,20 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
-  <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
-    <ImplicitUsings>disable</ImplicitUsings>
-    <Nullable>disable</Nullable>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Folder Include="wwwroot\" />
-  </ItemGroup>
-  
-  <ItemGroup>
-    <None Update="ocelot.json;appsettings.json">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Ocelot" Version="18.0.0" />
-    <PackageReference Include="Ocelot.Provider.Eureka" Version="18.0.0" />
-    <PackageReference Include="Ocelot.Provider.Polly" Version="18.0.0" />
-  </ItemGroup>
-
-</Project>
+﻿<Project Sdk="Microsoft.NET.Sdk.Web">
+  <PropertyGroup>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
+    <ImplicitUsings>disable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+  </PropertyGroup>
+  <ItemGroup>
+    <Folder Include="wwwroot\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Update="ocelot.json;appsettings.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\src\Ocelot.Provider.Eureka\Ocelot.Provider.Eureka.csproj" />
+    <ProjectReference Include="..\..\..\src\Ocelot.Provider.Polly\Ocelot.Provider.Polly.csproj" />
+    <ProjectReference Include="..\..\..\src\Ocelot\Ocelot.csproj" />
+  </ItemGroup>
+</Project>
diff --git a/samples/OcelotEureka/DownstreamService/DownstreamService.csproj b/samples/OcelotEureka/DownstreamService/DownstreamService.csproj
index 73f006405..e0d47d1c9 100644
--- a/samples/OcelotEureka/DownstreamService/DownstreamService.csproj
+++ b/samples/OcelotEureka/DownstreamService/DownstreamService.csproj
@@ -1,21 +1,16 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
-  <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
-    <ImplicitUsings>disable</ImplicitUsings>
-    <Nullable>disable</Nullable>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Folder Include="wwwroot\" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Steeltoe.Discovery.Client" Version="1.1.0" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
-  </ItemGroup>
-
-</Project>
+﻿<Project Sdk="Microsoft.NET.Sdk.Web">
+  <PropertyGroup>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
+    <ImplicitUsings>disable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+  </PropertyGroup>
+  <ItemGroup>
+    <Folder Include="wwwroot\" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Steeltoe.Discovery.Client" Version="1.1.0" />
+  </ItemGroup>
+  <ItemGroup>
+    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
+  </ItemGroup>
+</Project>
diff --git a/samples/OcelotGraphQL/OcelotGraphQL.csproj b/samples/OcelotGraphQL/OcelotGraphQL.csproj
index 6a7658f30..32039beba 100644
--- a/samples/OcelotGraphQL/OcelotGraphQL.csproj
+++ b/samples/OcelotGraphQL/OcelotGraphQL.csproj
@@ -1,19 +1,21 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-  <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
-    <ImplicitUsings>disable</ImplicitUsings>
-    <Nullable>disable</Nullable>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Update="ocelot.json;appsettings.json">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="wwwroot\" />
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Include="Ocelot" Version="18.0.0" />
-    <PackageReference Include="GraphQL" Version="4.8.0" />
-  </ItemGroup>
+﻿<Project Sdk="Microsoft.NET.Sdk.Web">
+  <PropertyGroup>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
+    <ImplicitUsings>disable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+  </PropertyGroup>
+  <ItemGroup>
+    <Folder Include="wwwroot\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Update="ocelot.json;appsettings.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="GraphQL" Version="4.8.0" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
+  </ItemGroup>
 </Project>
diff --git a/samples/OcelotKube/ApiGateway/Ocelot.Samples.OcelotKube.ApiGateway.csproj b/samples/OcelotKube/ApiGateway/Ocelot.Samples.OcelotKube.ApiGateway.csproj
index 548b13d79..f88cd602b 100644
--- a/samples/OcelotKube/ApiGateway/Ocelot.Samples.OcelotKube.ApiGateway.csproj
+++ b/samples/OcelotKube/ApiGateway/Ocelot.Samples.OcelotKube.ApiGateway.csproj
@@ -1,20 +1,16 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk.Web">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
     <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
   </PropertyGroup>
-
   <ItemGroup>
-    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
+    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\..\..\src\Ocelot.Provider.Kubernetes\Ocelot.Provider.Kubernetes.csproj" />
     <ProjectReference Include="..\..\..\src\Ocelot\Ocelot.csproj" />
   </ItemGroup>
-
 </Project>
diff --git a/samples/OcelotKube/DownstreamService/Ocelot.Samples.OcelotKube.DownstreamService.csproj b/samples/OcelotKube/DownstreamService/Ocelot.Samples.OcelotKube.DownstreamService.csproj
index 914c863da..3c1cfefb2 100644
--- a/samples/OcelotKube/DownstreamService/Ocelot.Samples.OcelotKube.DownstreamService.csproj
+++ b/samples/OcelotKube/DownstreamService/Ocelot.Samples.OcelotKube.DownstreamService.csproj
@@ -1,5 +1,4 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
-
   <PropertyGroup>
     <TargetFramework>net7.0</TargetFramework>
     <ImplicitUsings>disable</ImplicitUsings>
@@ -7,10 +6,7 @@
     <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
     <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
   </PropertyGroup>
-
   <ItemGroup>
-    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
   </ItemGroup>
-
 </Project>
diff --git a/samples/OcelotOpenTracing/OcelotOpenTracing.csproj b/samples/OcelotOpenTracing/OcelotOpenTracing.csproj
index 4c7ccf28a..a05368868 100644
--- a/samples/OcelotOpenTracing/OcelotOpenTracing.csproj
+++ b/samples/OcelotOpenTracing/OcelotOpenTracing.csproj
@@ -1,22 +1,30 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk.Worker">
-
   <PropertyGroup>
     <OutputType>Exe</OutputType>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
   </PropertyGroup>
-
   <ItemGroup>
     <PackageReference Include="Jaeger" Version="1.0.3" />
-    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
+    
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\..\src\Ocelot.Tracing.OpenTracing\Ocelot.Tracing.OpenTracing.csproj" />
     <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
   </ItemGroup>
-
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
+  </ItemGroup>
   <ItemGroup>
     <Content Update="appsettings.Development.json">
       <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
@@ -28,5 +36,4 @@
       <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
     </Content>
   </ItemGroup>
-
 </Project>
diff --git a/samples/OcelotServiceDiscovery/ApiGateway/Ocelot.Samples.ServiceDiscovery.ApiGateway.csproj b/samples/OcelotServiceDiscovery/ApiGateway/Ocelot.Samples.ServiceDiscovery.ApiGateway.csproj
index e987ea143..aac1dd20a 100644
--- a/samples/OcelotServiceDiscovery/ApiGateway/Ocelot.Samples.ServiceDiscovery.ApiGateway.csproj
+++ b/samples/OcelotServiceDiscovery/ApiGateway/Ocelot.Samples.ServiceDiscovery.ApiGateway.csproj
@@ -1,11 +1,8 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
   </PropertyGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\..\..\src\Ocelot\Ocelot.csproj" />
   </ItemGroup>
-
 </Project>
diff --git a/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj b/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj
index 07284008b..c97238c53 100644
--- a/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj
+++ b/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj
@@ -1,23 +1,23 @@
-﻿<Project Sdk="Microsoft.NET.Sdk.Web">
-  <PropertyGroup>
-    <Description>Stateless Web Service for Stateful OcelotApplicationApiGateway App</Description>
-    <TargetFramework>net7.0</TargetFramework>
-    <ImplicitUsings>disable</ImplicitUsings>
-    <Nullable>disable</Nullable>
-    <AssemblyName>OcelotApplicationApiGateway</AssemblyName>
-    <PackageId>OcelotApplicationApiGateway</PackageId>
-    <PlatformTarget>x64</PlatformTarget>
-  </PropertyGroup>
-    <ItemGroup>
-    <None Update="ocelot.json;appsettings.json;">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Include="Microsoft.ServiceFabric" Version="9.1.1799" />
-    <PackageReference Include="Microsoft.ServiceFabric.Services" Version="6.1.1799" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\src\Ocelot\Ocelot.csproj" />
-  </ItemGroup>
+﻿<Project Sdk="Microsoft.NET.Sdk.Web">
+  <PropertyGroup>
+    <Description>Stateless Web Service for Stateful OcelotApplicationApiGateway App</Description>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
+    <ImplicitUsings>disable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+    <AssemblyName>OcelotApplicationApiGateway</AssemblyName>
+    <PackageId>OcelotApplicationApiGateway</PackageId>
+    <PlatformTarget>x64</PlatformTarget>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Update="ocelot.json;appsettings.json;">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Microsoft.ServiceFabric" Version="10.1.1541" />
+    <PackageReference Include="Microsoft.ServiceFabric.Services" Version="7.1.1541" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\src\Ocelot\Ocelot.csproj" />
+  </ItemGroup>
 </Project>
diff --git a/samples/OcelotServiceFabric/src/OcelotApplicationService/OcelotApplicationService.csproj b/samples/OcelotServiceFabric/src/OcelotApplicationService/OcelotApplicationService.csproj
index 4bde15efc..6dc51c893 100644
--- a/samples/OcelotServiceFabric/src/OcelotApplicationService/OcelotApplicationService.csproj
+++ b/samples/OcelotServiceFabric/src/OcelotApplicationService/OcelotApplicationService.csproj
@@ -1,7 +1,7 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk.Web">
   <PropertyGroup>
     <Description>Stateless Service Application</Description>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <AssemblyName>OcelotApplicationService</AssemblyName>
@@ -13,8 +13,8 @@
     <None Remove="global.json" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.ServiceFabric" Version="9.1.1799" />
-    <PackageReference Include="Microsoft.ServiceFabric.Services" Version="6.1.1799" />
-    <PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="6.1.1799" />
+    <PackageReference Include="Microsoft.ServiceFabric" Version="10.1.1541" />
+    <PackageReference Include="Microsoft.ServiceFabric.Services" Version="7.1.1541" />
+    <PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="7.1.1541" />
   </ItemGroup>
 </Project>
diff --git a/src/Ocelot.Administration/Ocelot.Administration.csproj b/src/Ocelot.Administration/Ocelot.Administration.csproj
index 4b075c29d..4bb397ab3 100644
--- a/src/Ocelot.Administration/Ocelot.Administration.csproj
+++ b/src/Ocelot.Administration/Ocelot.Administration.csproj
@@ -1,6 +1,6 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <NoPackageAnalysis>true</NoPackageAnalysis>
@@ -12,7 +12,7 @@
     <PackageTags>API Gateway;.NET core</PackageTags>
     <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Administration</PackageProjectUrl>
     <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
     <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
@@ -26,11 +26,12 @@
     <DebugType>full</DebugType>
     <DebugSymbols>True</DebugSymbols>
   </PropertyGroup>
+  <!-- Project dependencies -->
   <ItemGroup>
     <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
     <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
@@ -39,4 +40,19 @@
   <ItemGroup>
     <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
   </ItemGroup>
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.25" />
+    <PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.14" />
+    <PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
+    <PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
+  </ItemGroup>
 </Project>
diff --git a/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj b/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj
index f4f40691a..4636540bc 100644
--- a/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj
+++ b/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj
@@ -1,6 +1,6 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <NoPackageAnalysis>true</NoPackageAnalysis>
@@ -12,7 +12,7 @@
     <PackageTags>API Gateway;.NET core</PackageTags>
     <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Cache.CacheManager</PackageProjectUrl>
     <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
     <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
@@ -26,11 +26,12 @@
     <DebugType>full</DebugType>
     <DebugSymbols>True</DebugSymbols>
   </PropertyGroup>
+  <!-- Project dependencies -->
   <ItemGroup>
     <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
     <PackageReference Include="CacheManager.Core" Version="2.0.0-beta-1629" />
@@ -40,4 +41,28 @@
   <ItemGroup>
     <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
   </ItemGroup>
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
+    <PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.11" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
+    <PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
+    <PackageReference Include="Microsoft.NETCore.Platforms" Version="8.0.0-preview.7.23375.6" />
+  </ItemGroup>
 </Project>
diff --git a/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj b/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj
index b9cdb1127..f8149b859 100644
--- a/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj
+++ b/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj
@@ -1,6 +1,6 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <NoPackageAnalysis>true</NoPackageAnalysis>
@@ -12,7 +12,7 @@
     <PackageTags>API Gateway;.NET core</PackageTags>
     <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Provider.Consul</PackageProjectUrl>
     <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
     <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
@@ -30,8 +30,8 @@
     <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Consul" Version="1.6.10.9" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
+    <PackageReference Include="Consul" Version="1.7.14.1" />
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
   </ItemGroup>
diff --git a/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj b/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj
index 92b1ba985..b7d578440 100644
--- a/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj
+++ b/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj
@@ -1,43 +1,43 @@
-﻿<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
-    <ImplicitUsings>disable</ImplicitUsings>
-    <Nullable>disable</Nullable>
-    <NoPackageAnalysis>true</NoPackageAnalysis>
-    <Description>Provides Ocelot extensions to use Eureka</Description>
-    <AssemblyTitle>Ocelot.Provider.Eureka</AssemblyTitle>
-    <VersionPrefix>0.0.0-dev</VersionPrefix>
-    <AssemblyName>Ocelot.Provider.Eureka</AssemblyName>
-    <PackageId>Ocelot.Provider.Eureka</PackageId>
-    <PackageTags>API Gateway;.NET core</PackageTags>
-    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Provider.Eureka</PackageProjectUrl>
-    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Provider.Eureka</PackageProjectUrl>
-    <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
-    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
-    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
-    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
-    <Authors>Tom Pallister</Authors>
-    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
-    <GenerateDocumentationFile>True</GenerateDocumentationFile>
-    <NoWarn>1591</NoWarn>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-    <DebugType>full</DebugType>
-    <DebugSymbols>True</DebugSymbols>
-  </PropertyGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.2.3" />
-    <PackageReference Include="Steeltoe.Discovery.Eureka" Version="3.2.3" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
-      <PrivateAssets>all</PrivateAssets>
-    </PackageReference>
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
-  </ItemGroup>
-</Project>
+﻿<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
+    <ImplicitUsings>disable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+    <NoPackageAnalysis>true</NoPackageAnalysis>
+    <Description>Provides Ocelot extensions to use Eureka</Description>
+    <AssemblyTitle>Ocelot.Provider.Eureka</AssemblyTitle>
+    <VersionPrefix>0.0.0-dev</VersionPrefix>
+    <AssemblyName>Ocelot.Provider.Eureka</AssemblyName>
+    <PackageId>Ocelot.Provider.Eureka</PackageId>
+    <PackageTags>API Gateway;.NET core</PackageTags>
+    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Provider.Eureka</PackageProjectUrl>
+    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Provider.Eureka</PackageProjectUrl>
+    <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
+    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
+    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+    <Authors>Tom Pallister</Authors>
+    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
+    <GenerateDocumentationFile>True</GenerateDocumentationFile>
+    <NoWarn>1591</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DebugType>full</DebugType>
+    <DebugSymbols>True</DebugSymbols>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.2.5" />
+    <PackageReference Include="Steeltoe.Discovery.Eureka" Version="3.2.5" />
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
+  </ItemGroup>
+</Project>
diff --git a/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj b/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj
index 92afba3aa..375b89535 100644
--- a/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj
+++ b/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj
@@ -1,7 +1,6 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <NoPackageAnalysis>true</NoPackageAnalysis>
@@ -13,7 +12,7 @@
     <AssemblyName>Ocelot.Provider.Kubernetes</AssemblyName>
     <PackageId>Ocelot.Provider.Kubernetes</PackageId>
     <PackageTags>API Gateway;.NET core</PackageTags>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
     <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -25,26 +24,21 @@
     <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>1591</NoWarn>
   </PropertyGroup>
-
   <ItemGroup>
     <Compile Remove="IKubeApiClientFactory.cs" />
     <Compile Remove="KubeApiClientFactory.cs" />
   </ItemGroup>
-
   <ItemGroup>
     <PackageReference Include="KubeClient" Version="2.4.10" />
     <PackageReference Include="KubeClient.Extensions.DependencyInjection" Version="2.4.10" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
   </ItemGroup>
-
   <ItemGroup>
     <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
   </ItemGroup>
-
 </Project>
diff --git a/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj b/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj
index 4ffcb9eb6..a75db00e8 100644
--- a/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj
+++ b/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj
@@ -1,6 +1,6 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <NoPackageAnalysis>true</NoPackageAnalysis>
@@ -13,7 +13,7 @@
     <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Provider.Polly</PackageProjectUrl>
     <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot.Provider.Polly</PackageProjectUrl>
     <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
     <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
@@ -31,10 +31,10 @@
     <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
   </ItemGroup>
   <ItemGroup>
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
-    <PackageReference Include="Polly" Version="7.2.3" />
+    <PackageReference Include="Polly" Version="8.2.0" />
   </ItemGroup>
   <ItemGroup>
     <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
diff --git a/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj b/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj
index a955c6f0c..68b90652f 100644
--- a/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj
+++ b/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj
@@ -1,45 +1,43 @@
-﻿<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
-    <ImplicitUsings>disable</ImplicitUsings>
-    <Nullable>disable</Nullable>
-    <NoPackageAnalysis>true</NoPackageAnalysis>
-    <Description>This package provides methods to integrate Butterfly tracing with Ocelot.</Description>
-    <AssemblyTitle>Ocelot.Tracing.Butterfly</AssemblyTitle>
-    <VersionPrefix>0.0.0-dev</VersionPrefix>
-    <AssemblyName>Ocelot.Tracing.Butterfly</AssemblyName>
-    <PackageId>Ocelot.Tracing.Butterfly</PackageId>
-    <PackageTags>API Gateway;.NET core; Butterfly; ButterflyAPM</PackageTags>
-    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
-    <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
-    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
-    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
-    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
-    <Authors>Tom Pallister</Authors>
-    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
-    <RootNamespace>Ocelot.Tracing.Butterfly</RootNamespace>
-    <GenerateDocumentationFile>True</GenerateDocumentationFile>
-    <NoWarn>1591</NoWarn>
-  </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-    <DebugType>full</DebugType>
-    <DebugSymbols>True</DebugSymbols>
-  </PropertyGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Include="Butterfly.Client" Version="0.0.8" />
-    <PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
-      <PrivateAssets>all</PrivateAssets>
-    </PackageReference>
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
-  </ItemGroup>
-
-</Project>
+﻿<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
+    <ImplicitUsings>disable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+    <NoPackageAnalysis>true</NoPackageAnalysis>
+    <Description>This package provides methods to integrate Butterfly tracing with Ocelot.</Description>
+    <AssemblyTitle>Ocelot.Tracing.Butterfly</AssemblyTitle>
+    <VersionPrefix>0.0.0-dev</VersionPrefix>
+    <AssemblyName>Ocelot.Tracing.Butterfly</AssemblyName>
+    <PackageId>Ocelot.Tracing.Butterfly</PackageId>
+    <PackageTags>API Gateway;.NET core; Butterfly; ButterflyAPM</PackageTags>
+    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
+    <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
+    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
+    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+    <Authors>Tom Pallister</Authors>
+    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
+    <RootNamespace>Ocelot.Tracing.Butterfly</RootNamespace>
+    <GenerateDocumentationFile>True</GenerateDocumentationFile>
+    <NoWarn>1591</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DebugType>full</DebugType>
+    <DebugSymbols>True</DebugSymbols>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Butterfly.Client" Version="0.0.8" />
+    <PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
+  </ItemGroup>
+</Project>
diff --git a/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj b/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj
index e3b7336bf..635e3c77d 100644
--- a/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj
+++ b/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj
@@ -1,7 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <Version>0.0.0-dev</Version>
@@ -15,21 +14,17 @@
     <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
     <NoWarn>1591</NoWarn>
   </PropertyGroup>
-
   <ItemGroup>
     <AdditionalFiles Include="stylecop.json" />
     <None Include="..\..\images\ocelot_logo.png" Pack="true" Visible="true" PackagePath="\" />
   </ItemGroup>
-
   <ItemGroup>
     <PackageReference Include="OpenTracing" Version="0.12.1" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\Ocelot\Ocelot.csproj" />
   </ItemGroup>
-
 </Project>
diff --git a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs
index 6e8c79308..4649ecd0b 100644
--- a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs
+++ b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs
@@ -14,8 +14,16 @@ public static partial class ConfigurationBuilderExtensions
         public const string PrimaryConfigFile = "ocelot.json";
         public const string GlobalConfigFile = "ocelot.global.json";
 
-        [GeneratedRegex("^ocelot\\.(.*?)\\.json$", RegexOptions.IgnoreCase | RegexOptions.Singleline, "en-US")]
+#if NET7_0_OR_GREATER
+        [GeneratedRegex(@"^ocelot\.(.*?)\.json$", RegexOptions.IgnoreCase | RegexOptions.Singleline, "en-US")]
         private static partial Regex SubConfigRegex();
+#else
+        private static readonly Regex SubConfigRegexVar = new(@"^ocelot\.(.*?)\.json$", RegexOptions.IgnoreCase | RegexOptions.Singleline, TimeSpan.FromMilliseconds(1000));
+        private static Regex SubConfigRegex()
+        {
+            return SubConfigRegexVar;
+        }
+#endif
 
         [Obsolete("Please set BaseUrl in ocelot.json GlobalConfiguration.BaseUrl")]
         public static IConfigurationBuilder AddOcelotBaseUrl(this IConfigurationBuilder builder, string baseUrl)
diff --git a/src/Ocelot/Headers/AddHeadersToRequest.cs b/src/Ocelot/Headers/AddHeadersToRequest.cs
index f33f36c73..d5a8c0629 100644
--- a/src/Ocelot/Headers/AddHeadersToRequest.cs
+++ b/src/Ocelot/Headers/AddHeadersToRequest.cs
@@ -68,11 +68,11 @@ public void SetHeadersOnDownstreamRequest(IEnumerable<AddHeader> headers, HttpCo
                         continue;
                     }
 
-                    requestHeader.Add(header.Key, new StringValues(value.Data));
+                    requestHeader.Append(header.Key, new StringValues(value.Data));
                 }
                 else
                 {
-                    requestHeader.Add(header.Key, header.Value);
+                    requestHeader.Append(header.Key, header.Value);
                 }
             }
         }
diff --git a/src/Ocelot/Headers/HttpContextRequestHeaderReplacer.cs b/src/Ocelot/Headers/HttpContextRequestHeaderReplacer.cs
index 85c6ad7d8..ec0a8c0da 100644
--- a/src/Ocelot/Headers/HttpContextRequestHeaderReplacer.cs
+++ b/src/Ocelot/Headers/HttpContextRequestHeaderReplacer.cs
@@ -14,7 +14,7 @@ public Response Replace(HttpContext context, List<HeaderFindAndReplace> fAndRs)
                 {
                     var replaced = values[f.Index].Replace(f.Find, f.Replace);
                     context.Request.Headers.Remove(f.Key);
-                    context.Request.Headers.Add(f.Key, replaced);
+                    context.Request.Headers.Append(f.Key, replaced);
                 }
             }
 
diff --git a/src/Ocelot/Ocelot.csproj b/src/Ocelot/Ocelot.csproj
index bc71e34ac..19f0a5bdc 100644
--- a/src/Ocelot/Ocelot.csproj
+++ b/src/Ocelot/Ocelot.csproj
@@ -1,46 +1,58 @@
-﻿<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
-    <ImplicitUsings>disable</ImplicitUsings>
-    <Nullable>disable</Nullable>
-    <NoPackageAnalysis>true</NoPackageAnalysis>
-    <Description>Ocelot is an API Gateway. The project is aimed at people using .NET running a micro services / service orientated architecture that need a unified point of entry into their system. In particular I want easy integration with IdentityServer reference and bearer tokens.  reference tokens. Ocelot is a bunch of middlewares in a specific order. Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is stored in a per request scoped repository and retrived as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features.</Description>
-    <AssemblyTitle>Ocelot</AssemblyTitle>
-    <VersionPrefix>0.0.0-dev</VersionPrefix>
-    <AssemblyName>Ocelot</AssemblyName>
-    <PackageId>Ocelot</PackageId>
-    <PackageTags>API Gateway;.NET core</PackageTags>
-    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
-    <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
-    <RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
-    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
-    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
-    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
-    <Authors>Tom Pallister</Authors>
-    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
+﻿<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
+    <ImplicitUsings>disable</ImplicitUsings>
+    <Nullable>disable</Nullable>
+    <NoPackageAnalysis>true</NoPackageAnalysis>
+    <Description>Ocelot is an API Gateway. The project is aimed at people using .NET running a micro services / service orientated architecture that need a unified point of entry into their system. In particular I want easy integration with IdentityServer reference and bearer tokens.  reference tokens. Ocelot is a bunch of middlewares in a specific order. Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is stored in a per request scoped repository and retrived as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features.</Description>
+    <AssemblyTitle>Ocelot</AssemblyTitle>
+    <VersionPrefix>0.0.0-dev</VersionPrefix>
+    <AssemblyName>Ocelot</AssemblyName>
+    <PackageId>Ocelot</PackageId>
+    <PackageTags>API Gateway;.NET core</PackageTags>
+    <PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
+    <PackageIconUrl>https://raw.githubusercontent.com/ThreeMammals/Ocelot/develop/images/ocelot_logo.png</PackageIconUrl>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
+    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
+    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+    <Authors>Tom Pallister</Authors>
+    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
     <GenerateDocumentationFile>True</GenerateDocumentationFile>
-    <NoWarn>1591</NoWarn>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-    <DebugType>full</DebugType>
-    <DebugSymbols>True</DebugSymbols>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="FluentValidation" Version="11.5.2" />
-    <PackageReference Include="IPAddressRange" Version="6.0.0" />
-    <PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="7.0.5" />
-    <PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.32">
-      <NoWarn>NU1701</NoWarn>
-    </PackageReference>
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.5" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
-      <PrivateAssets>all</PrivateAssets>
-    </PackageReference>
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
-  </ItemGroup>
-
-</Project>
+    <NoWarn>1591</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DebugType>full</DebugType>
+    <DebugSymbols>True</DebugSymbols>
+  </PropertyGroup>
+  <!-- Project dependencies -->
+  <ItemGroup>
+    <PackageReference Include="FluentValidation" Version="11.8.0" />
+    <PackageReference Include="IPAddressRange" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.32">
+      <NoWarn>NU1701</NoWarn>
+    </PackageReference>
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="6.0.25" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.25" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="7.0.14" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.14" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="8.0.0" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
+  </ItemGroup>
+</Project>
diff --git a/src/Ocelot/Responder/HttpContextResponder.cs b/src/Ocelot/Responder/HttpContextResponder.cs
index 4e4fb6ba5..2c21e0c9e 100644
--- a/src/Ocelot/Responder/HttpContextResponder.cs
+++ b/src/Ocelot/Responder/HttpContextResponder.cs
@@ -93,7 +93,7 @@ private static void AddHeaderIfDoesntExist(HttpContext context, Header httpRespo
         {
             if (!context.Response.Headers.ContainsKey(httpResponseHeader.Key))
             {
-                context.Response.Headers.Add(httpResponseHeader.Key, new StringValues(httpResponseHeader.Values.ToArray()));
+                context.Response.Headers.Append(httpResponseHeader.Key, new StringValues(httpResponseHeader.Values.ToArray()));
             }
         }
     }
diff --git a/src/Ocelot/WebSockets/ClientWebSocketOptionsProxy.cs b/src/Ocelot/WebSockets/ClientWebSocketOptionsProxy.cs
index fea55c146..bf336b54f 100644
--- a/src/Ocelot/WebSockets/ClientWebSocketOptionsProxy.cs
+++ b/src/Ocelot/WebSockets/ClientWebSocketOptionsProxy.cs
@@ -13,8 +13,17 @@ public ClientWebSocketOptionsProxy(ClientWebSocketOptions options)
         _real = options;
     }
 
+    // .NET 6 and lower doesn't support the properties below.
+    // Instead of throwing a NotSupportedException, we just implement the getter/setter.
+    // This way, we can use the same code for .NET 6 and .NET 7+.
+    // TODO The design should be reviewed since we are hiding the ClientWebSocketOptions properties.
+#if NET7_0_OR_GREATER
     public Version HttpVersion { get => _real.HttpVersion; set => _real.HttpVersion = value; }
     public HttpVersionPolicy HttpVersionPolicy { get => _real.HttpVersionPolicy; set => _real.HttpVersionPolicy = value; }
+#else
+    public Version HttpVersion { get; set; }
+    public HttpVersionPolicy HttpVersionPolicy { get; set; }
+#endif
     public bool UseDefaultCredentials { get => _real.UseDefaultCredentials; set => _real.UseDefaultCredentials = value; }
     public ICredentials Credentials { get => _real.Credentials; set => _real.Credentials = value; }
     public IWebProxy Proxy { get => _real.Proxy; set => _real.Proxy = value; }
@@ -23,8 +32,11 @@ public ClientWebSocketOptionsProxy(ClientWebSocketOptions options)
     public CookieContainer Cookies { get => _real.Cookies; set => _real.Cookies = value; }
     public TimeSpan KeepAliveInterval { get => _real.KeepAliveInterval; set => _real.KeepAliveInterval = value; }
     public WebSocketDeflateOptions DangerousDeflateOptions { get => _real.DangerousDeflateOptions; set => _real.DangerousDeflateOptions = value; }
+#if NET7_0_OR_GREATER
     public bool CollectHttpResponseDetails { get => _real.CollectHttpResponseDetails; set => _real.CollectHttpResponseDetails = value; }
-
+#else
+    public bool CollectHttpResponseDetails { get; set; }
+#endif
     public void AddSubProtocol(string subProtocol) => _real.AddSubProtocol(subProtocol);
 
     public void SetBuffer(int receiveBufferSize, int sendBufferSize) => _real.SetBuffer(receiveBufferSize, sendBufferSize);


Test patch:
diff --git a/test/Ocelot.AcceptanceTests/CachingTests.cs b/test/Ocelot.AcceptanceTests/CachingTests.cs
index 95f6f5166..b2ef34d6c 100644
--- a/test/Ocelot.AcceptanceTests/CachingTests.cs
+++ b/test/Ocelot.AcceptanceTests/CachingTests.cs
@@ -211,7 +211,7 @@ private void GivenThereIsAServiceRunningOn(string url, int statusCode, string re
             {
                 if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(key))
                 {
-                    context.Response.Headers.Add(key, value);
+                    context.Response.Headers.Append(key, value);
                 }
 
                 context.Response.StatusCode = statusCode;
diff --git a/test/Ocelot.AcceptanceTests/ConsulConfigurationInConsulTests.cs b/test/Ocelot.AcceptanceTests/ConsulConfigurationInConsulTests.cs
index f138675b9..6d0c31a3a 100644
--- a/test/Ocelot.AcceptanceTests/ConsulConfigurationInConsulTests.cs
+++ b/test/Ocelot.AcceptanceTests/ConsulConfigurationInConsulTests.cs
@@ -370,7 +370,7 @@ private void GivenThereIsAFakeConsulServiceDiscoveryProvider(string url, string
 
                                         var kvp = new FakeConsulGetResponse(base64);
                                         json = JsonConvert.SerializeObject(new[] { kvp });
-                                        context.Response.Headers.Add("Content-Type", "application/json");
+                                        context.Response.Headers.Append("Content-Type", "application/json");
                                         await context.Response.WriteAsync(json);
                                     }
                                     else if (context.Request.Method.ToLower() == "put" && context.Request.Path.Value == "/v1/kv/InternalConfiguration")
@@ -398,7 +398,7 @@ private void GivenThereIsAFakeConsulServiceDiscoveryProvider(string url, string
                                     else if (context.Request.Path.Value == $"/v1/health/service/{serviceName}")
                                     {
                                         var json = JsonConvert.SerializeObject(_consulServices);
-                                        context.Response.Headers.Add("Content-Type", "application/json");
+                                        context.Response.Headers.Append("Content-Type", "application/json");
                                         await context.Response.WriteAsync(json);
                                     }
                                 });
diff --git a/test/Ocelot.AcceptanceTests/ConsulWebSocketTests.cs b/test/Ocelot.AcceptanceTests/ConsulWebSocketTests.cs
index d03d7e6b9..38e4e18c8 100644
--- a/test/Ocelot.AcceptanceTests/ConsulWebSocketTests.cs
+++ b/test/Ocelot.AcceptanceTests/ConsulWebSocketTests.cs
@@ -126,7 +126,7 @@ private void GivenThereIsAFakeConsulServiceDiscoveryProvider(string url, string
                 if (context.Request.Path.Value == $"/v1/health/service/{serviceName}")
                 {
                     var json = JsonConvert.SerializeObject(_serviceEntries);
-                    context.Response.Headers.Add("Content-Type", "application/json");
+                    context.Response.Headers.Append("Content-Type", "application/json");
                     await context.Response.WriteAsync(json);
                 }
             });
diff --git a/test/Ocelot.AcceptanceTests/EurekaServiceDiscoveryTests.cs b/test/Ocelot.AcceptanceTests/EurekaServiceDiscoveryTests.cs
index 8def02990..1be8c7798 100644
--- a/test/Ocelot.AcceptanceTests/EurekaServiceDiscoveryTests.cs
+++ b/test/Ocelot.AcceptanceTests/EurekaServiceDiscoveryTests.cs
@@ -141,7 +141,7 @@ private void GivenThereIsAFakeEurekaServiceDiscoveryProvider(string url, string
                     };
 
                     var json = JsonConvert.SerializeObject(applications);
-                    context.Response.Headers.Add("Content-Type", "application/json");
+                    context.Response.Headers.Append("Content-Type", "application/json");
                     await context.Response.WriteAsync(json);
                 }
             });
diff --git a/test/Ocelot.AcceptanceTests/HeaderTests.cs b/test/Ocelot.AcceptanceTests/HeaderTests.cs
index 5a28e1753..1a7979a1d 100644
--- a/test/Ocelot.AcceptanceTests/HeaderTests.cs
+++ b/test/Ocelot.AcceptanceTests/HeaderTests.cs
@@ -448,7 +448,7 @@ private void GivenThereIsAServiceRunningOn(string baseUrl, string basePath, int
             {
                 context.Response.OnStarting(() =>
                 {
-                    context.Response.Headers.Add(headerKey, headerValue);
+                    context.Response.Headers.Append(headerKey, headerValue);
                     context.Response.StatusCode = statusCode;
                     return Task.CompletedTask;
                 });
diff --git a/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj b/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
index c54810e36..760b03bae 100644
--- a/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
+++ b/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
@@ -1,53 +1,51 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
-	<PropertyGroup>
-		<VersionPrefix>0.0.0-dev</VersionPrefix>
-		<TargetFramework>net7.0</TargetFramework>
+  <PropertyGroup>
+    <VersionPrefix>0.0.0-dev</VersionPrefix>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <IsPackable>false</IsPackable>
     <IsTestProject>true</IsTestProject>
     <AssemblyName>Ocelot.AcceptanceTests</AssemblyName>
-		<OutputType>Exe</OutputType>
-		<PackageId>Ocelot.AcceptanceTests</PackageId>
-		<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
-		<RuntimeIdentifiers>osx.10.11-x64;osx.10.12-x64;win7-x64;win10-x64</RuntimeIdentifiers>
-		<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
-		<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
-		<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
-		<CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
-		<GenerateDocumentationFile>True</GenerateDocumentationFile>
+    <OutputType>Exe</OutputType>
+    <PackageId>Ocelot.AcceptanceTests</PackageId>
+    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
+    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
+    <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>1591</NoWarn>
   </PropertyGroup>
-
-	<ItemGroup>
-		<None Update="appsettings.product.json">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-		<None Update="appsettings.json">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-		<None Update="mycert.pfx">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
-	<ItemGroup>
-		<ProjectReference Include="..\..\src\Ocelot.Tracing.Butterfly\Ocelot.Tracing.Butterfly.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Tracing.OpenTracing\Ocelot.Tracing.OpenTracing.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Cache.CacheManager\Ocelot.Cache.CacheManager.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Consul\Ocelot.Provider.Consul.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Eureka\Ocelot.Provider.Eureka.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Polly\Ocelot.Provider.Polly.csproj" />
-		<ProjectReference Include="..\Ocelot.ManualTest\Ocelot.ManualTest.csproj" />
-	</ItemGroup>
-	<ItemGroup>
-		<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
-	</ItemGroup>
-
-	<ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
-    <PackageReference Include="xunit" Version="2.5.0" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
+  <ItemGroup>
+    <None Update="appsettings.product.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Update="appsettings.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Update="mycert.pfx">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\src\Ocelot.Tracing.Butterfly\Ocelot.Tracing.Butterfly.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Tracing.OpenTracing\Ocelot.Tracing.OpenTracing.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Cache.CacheManager\Ocelot.Cache.CacheManager.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Consul\Ocelot.Provider.Consul.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Eureka\Ocelot.Provider.Eureka.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Polly\Ocelot.Provider.Polly.csproj" />
+    <ProjectReference Include="..\Ocelot.ManualTest\Ocelot.ManualTest.csproj" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
+    <PackageReference Include="xunit" Version="2.6.1" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
@@ -55,31 +53,58 @@
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
-    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.5" />
-		<PackageReference Include="Moq" Version="4.18.4" />
-		<PackageReference Include="OpenTracing" Version="0.12.1" />
-		<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
-			<PrivateAssets>all</PrivateAssets>
-		</PackageReference>
-		<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
-		<PackageReference Include="Shouldly" Version="4.1.0" />
-		<PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
-		<PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
-		<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
-		<PackageReference Include="IdentityServer4" Version="4.1.2" />
-		<PackageReference Include="Consul" Version="1.6.10.9" />
-		<PackageReference Include="CacheManager.Microsoft.Extensions.Logging" Version="2.0.0-beta-1629" />
-		<PackageReference Include="CacheManager.Serialization.Json" Version="2.0.0-beta-1629" />
-		<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.2.3" />
-	</ItemGroup>
-	<ItemGroup>
-		<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
-	</ItemGroup>
+    <PackageReference Include="Moq" Version="4.20.69" />
+    <PackageReference Include="OpenTracing" Version="0.12.1" />
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+    <PackageReference Include="Shouldly" Version="4.2.1" />
+    <PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
+    <PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
+    <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
+    <PackageReference Include="IdentityServer4" Version="4.1.2" />
+    <PackageReference Include="Consul" Version="1.7.14.1" />
+    <PackageReference Include="CacheManager.Microsoft.Extensions.Logging" Version="2.0.0-beta-1629" />
+    <PackageReference Include="CacheManager.Serialization.Json" Version="2.0.0-beta-1629" />
+    <PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.2.5" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.25" />
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.14" />
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
+  </ItemGroup>
 </Project>
diff --git a/test/Ocelot.AcceptanceTests/PollyQoSTests.cs b/test/Ocelot.AcceptanceTests/PollyQoSTests.cs
index c182721ad..9d8f3ec39 100644
--- a/test/Ocelot.AcceptanceTests/PollyQoSTests.cs
+++ b/test/Ocelot.AcceptanceTests/PollyQoSTests.cs
@@ -6,7 +6,6 @@ namespace Ocelot.AcceptanceTests
     public class PollyQoSTests : IDisposable
     {
         private readonly Steps _steps;
-        private int _requestCount;
         private readonly ServiceHandler _serviceHandler;
 
         public PollyQoSTests()
@@ -227,32 +226,17 @@ private static void GivenIWaitMilliseconds(int ms)
 
         private void GivenThereIsAPossiblyBrokenServiceRunningOn(string url, string responseBody)
         {
+            var requestCount = 0;
             _serviceHandler.GivenThereIsAServiceRunningOn(url, async context =>
             {
-                //circuit starts closed
-                if (_requestCount == 0)
+                if (requestCount == 1)
                 {
-                    _requestCount++;
-                    context.Response.StatusCode = 200;
-                    await context.Response.WriteAsync(responseBody);
-                    return;
-                }
-
-                //request one times out and polly throws exception, circuit opens
-                if (_requestCount == 1)
-                {
-                    _requestCount++;
                     await Task.Delay(1000);
-                    context.Response.StatusCode = 200;
-                    return;
                 }
 
-                //after break closes we return 200 OK
-                if (_requestCount == 2)
-                {
-                    context.Response.StatusCode = 200;
-                    await context.Response.WriteAsync(responseBody);
-                }
+                requestCount++;
+                context.Response.StatusCode = 200;
+                await context.Response.WriteAsync(responseBody);
             });
         }
 
diff --git a/test/Ocelot.AcceptanceTests/RequestIdTests.cs b/test/Ocelot.AcceptanceTests/RequestIdTests.cs
index 2e7987846..e1de4f313 100644
--- a/test/Ocelot.AcceptanceTests/RequestIdTests.cs
+++ b/test/Ocelot.AcceptanceTests/RequestIdTests.cs
@@ -171,7 +171,7 @@ private void GivenThereIsAServiceRunningOn(string url)
             _serviceHandler.GivenThereIsAServiceRunningOn(url, context =>
             {
                 context.Request.Headers.TryGetValue(_steps.RequestIdKey, out var requestId);
-                context.Response.Headers.Add(_steps.RequestIdKey, requestId.First());
+                context.Response.Headers[_steps.RequestIdKey] = requestId.First();
                 return Task.CompletedTask;
             });
         }
diff --git a/test/Ocelot.AcceptanceTests/ServiceDiscoveryTests.cs b/test/Ocelot.AcceptanceTests/ServiceDiscoveryTests.cs
index 1814db1e8..c9f093bf0 100644
--- a/test/Ocelot.AcceptanceTests/ServiceDiscoveryTests.cs
+++ b/test/Ocelot.AcceptanceTests/ServiceDiscoveryTests.cs
@@ -516,7 +516,7 @@ private void GivenThereIsAFakeConsulServiceDiscoveryProvider(string url, string
                     }
 
                     var json = JsonConvert.SerializeObject(_consulServices);
-                    context.Response.Headers.Add("Content-Type", "application/json");
+                    context.Response.Headers.Append("Content-Type", "application/json");
                     await context.Response.WriteAsync(json);
                 }
             });
diff --git a/test/Ocelot.AcceptanceTests/TwoDownstreamServicesTests.cs b/test/Ocelot.AcceptanceTests/TwoDownstreamServicesTests.cs
index 30b3d7235..3a695bb9c 100644
--- a/test/Ocelot.AcceptanceTests/TwoDownstreamServicesTests.cs
+++ b/test/Ocelot.AcceptanceTests/TwoDownstreamServicesTests.cs
@@ -97,7 +97,7 @@ private void GivenThereIsAFakeConsulServiceDiscoveryProvider(string url)
                 if (context.Request.Path.Value == "/v1/health/service/product")
                 {
                     var json = JsonConvert.SerializeObject(_serviceEntries);
-                    context.Response.Headers.Add("Content-Type", "application/json");
+                    context.Response.Headers.Append("Content-Type", "application/json");
                     await context.Response.WriteAsync(json);
                 }
             });
diff --git a/test/Ocelot.Benchmarks/DownstreamRouteFinderMiddlewareBenchmarks.cs b/test/Ocelot.Benchmarks/DownstreamRouteFinderMiddlewareBenchmarks.cs
index cdf0002c7..4e99d1fe0 100644
--- a/test/Ocelot.Benchmarks/DownstreamRouteFinderMiddlewareBenchmarks.cs
+++ b/test/Ocelot.Benchmarks/DownstreamRouteFinderMiddlewareBenchmarks.cs
@@ -10,7 +10,7 @@
 
 namespace Ocelot.Benchmarks
 {
-    [SimpleJob(launchCount: 1, warmupCount: 2, targetCount: 5)]
+    [SimpleJob(launchCount: 1, warmupCount: 2, iterationCount: 5)]
     [Config(typeof(DownstreamRouteFinderMiddlewareBenchmarks))]
     public class DownstreamRouteFinderMiddlewareBenchmarks : ManualConfig
     {
@@ -51,7 +51,7 @@ public void SetUp()
                     QueryString = new QueryString("?a=b"),
                 },
             };
-            httpContext.Request.Headers.Add("Host", "most");
+            httpContext.Request.Headers.Append("Host", "most");
             httpContext.Items.SetIInternalConfiguration(new InternalConfiguration(new List<Route>(), null, null, null, null, null, null, null, null));
 
             _httpContext = httpContext;
diff --git a/test/Ocelot.Benchmarks/ExceptionHandlerMiddlewareBenchmarks.cs b/test/Ocelot.Benchmarks/ExceptionHandlerMiddlewareBenchmarks.cs
index 0dde79085..35e0f25b0 100644
--- a/test/Ocelot.Benchmarks/ExceptionHandlerMiddlewareBenchmarks.cs
+++ b/test/Ocelot.Benchmarks/ExceptionHandlerMiddlewareBenchmarks.cs
@@ -8,7 +8,7 @@
 
 namespace Ocelot.Benchmarks
 {
-    [SimpleJob(launchCount: 1, warmupCount: 2, targetCount: 5)]
+    [SimpleJob(launchCount: 1, warmupCount: 2, iterationCount: 5)]
     [Config(typeof(ExceptionHandlerMiddlewareBenchmarks))]
     public class ExceptionHandlerMiddlewareBenchmarks : ManualConfig
     {
diff --git a/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj b/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj
index 12081074d..ffbd2d8a4 100644
--- a/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj
+++ b/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj
@@ -1,8 +1,7 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
-
   <PropertyGroup>
     <VersionPrefix>0.0.0-dev</VersionPrefix>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <IsPackable>false</IsPackable>
@@ -10,7 +9,7 @@
     <AssemblyName>Ocelot.Benchmarks</AssemblyName>
     <OutputType>Exe</OutputType>
     <PackageId>Ocelot.Benchmarks</PackageId>
-    <RuntimeIdentifiers>osx.10.11-x64;osx.10.12-x64;win7-x64;win10-x64</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
     <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
     <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
     <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
@@ -18,18 +17,15 @@
     <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>1591</NoWarn>
   </PropertyGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
   </ItemGroup>
-
   <ItemGroup>
-    <PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
+    <PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
   </ItemGroup>
-
   <ItemGroup>
     <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
   </ItemGroup>
diff --git a/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj b/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj
index c78949e19..dbd821b49 100644
--- a/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj
+++ b/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj
@@ -1,44 +1,43 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
-	<PropertyGroup>
-		<VersionPrefix>0.0.0-dev</VersionPrefix>
-		<TargetFramework>net7.0</TargetFramework>
+  <PropertyGroup>
+    <VersionPrefix>0.0.0-dev</VersionPrefix>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <IsPackable>false</IsPackable>
     <IsTestProject>true</IsTestProject>
     <AssemblyName>Ocelot.IntegrationTests</AssemblyName>
-		<OutputType>Exe</OutputType>
-		<PackageId>Ocelot.IntegrationTests</PackageId>
-		<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
-		<RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
-		<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
-		<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
-		<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
-		<CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
-		<GenerateDocumentationFile>True</GenerateDocumentationFile>
+    <OutputType>Exe</OutputType>
+    <PackageId>Ocelot.IntegrationTests</PackageId>
+    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
+    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
+    <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>1591</NoWarn>
   </PropertyGroup>
-	<ItemGroup>
-		<None Update="peers.json;appsettings.json;mycert.pfx">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
-	<ItemGroup>
-		<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
-	</ItemGroup>
-	<ItemGroup>
-		<ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Administration\Ocelot.Administration.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Cache.CacheManager\Ocelot.Cache.CacheManager.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Consul\Ocelot.Provider.Consul.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Eureka\Ocelot.Provider.Eureka.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Polly\Ocelot.Provider.Polly.csproj" />
-	</ItemGroup>
-
-	<ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
-    <PackageReference Include="xunit" Version="2.5.0" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
+  <ItemGroup>
+    <None Update="peers.json;appsettings.json;mycert.pfx">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Administration\Ocelot.Administration.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Cache.CacheManager\Ocelot.Cache.CacheManager.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Consul\Ocelot.Provider.Consul.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Eureka\Ocelot.Provider.Eureka.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Polly\Ocelot.Provider.Polly.csproj" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
+    <PackageReference Include="xunit" Version="2.6.1" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
@@ -46,23 +45,48 @@
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
-		<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
-			<PrivateAssets>all</PrivateAssets>
-		</PackageReference>
-		<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
-		<PackageReference Include="Shouldly" Version="4.2.1" />
-		<PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
-		<PackageReference Include="Microsoft.Data.SQLite" Version="7.0.5" />
-		<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
-		<PackageReference Include="IdentityServer4" Version="4.1.2" />
-	</ItemGroup>
-	<ItemGroup>
-		<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
-	</ItemGroup>
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+    <PackageReference Include="Shouldly" Version="4.2.1" />
+    <PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
+    <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
+    <PackageReference Include="IdentityServer4" Version="4.1.2" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.Data.SQLite" Version="6.0.25" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
+    <PackageReference Include="Microsoft.Data.SQLite" Version="7.0.14" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.Data.SQLite" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
+  </ItemGroup>
 </Project>
diff --git a/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj b/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj
index 18601b7f0..81aabb2f1 100644
--- a/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj
+++ b/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj
@@ -1,14 +1,14 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk.Web">
   <PropertyGroup>
     <VersionPrefix>0.0.0-dev</VersionPrefix>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <PreserveCompilationContext>true</PreserveCompilationContext>
     <AssemblyName>Ocelot.ManualTest</AssemblyName>
     <OutputType>Exe</OutputType>
     <PackageId>Ocelot.ManualTest</PackageId>
-    <RuntimeIdentifiers>osx.10.11-x64;osx.10.12-x64;win7-x64;win10-x64</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
     <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
     <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>1591</NoWarn>
@@ -32,6 +32,22 @@
     <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
   </ItemGroup>
   <ItemGroup>
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
     <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
@@ -39,9 +55,16 @@
     <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
-    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
-      <PrivateAssets>all</PrivateAssets>
-    </PackageReference>
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
   </ItemGroup>
   <ItemGroup>
     <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
diff --git a/test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs b/test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs
index 98bfd1ea0..b36029232 100644
--- a/test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs
+++ b/test/Ocelot.UnitTests/Configuration/Validation/FileConfigurationFluentValidatorTests.cs
@@ -1564,11 +1564,20 @@ private class TestOptions : AuthenticationSchemeOptions
         }
 
         private class TestHandler : AuthenticationHandler<TestOptions>
-        {
+        {
+            // https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/8.0/isystemclock-obsolete
+            // .NET 8.0: TimeProvider is now a settable property on the Options classes for the authentication and identity components.
+            // It can be set directly or by registering a provider in the dependency injection container.
+#if NET8_0_OR_GREATER
+            public TestHandler(IOptionsMonitor<TestOptions> options, ILoggerFactory logger, UrlEncoder encoder) : base(options, logger, encoder)
+            {
+            }
+#else
             public TestHandler(IOptionsMonitor<TestOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
             {
-            }
-
+            }
+#endif
+
             protected override Task<AuthenticateResult> HandleAuthenticateAsync()
             {
                 var principal = new ClaimsPrincipal();
diff --git a/test/Ocelot.UnitTests/Consul/ConsulServiceDiscoveryProviderTests.cs b/test/Ocelot.UnitTests/Consul/ConsulServiceDiscoveryProviderTests.cs
index 115727676..e00c8a0af 100644
--- a/test/Ocelot.UnitTests/Consul/ConsulServiceDiscoveryProviderTests.cs
+++ b/test/Ocelot.UnitTests/Consul/ConsulServiceDiscoveryProviderTests.cs
@@ -205,7 +205,7 @@ private void GivenThereIsAFakeConsulServiceDiscoveryProvider(string url, string
                             }
 
                             var json = JsonConvert.SerializeObject(_serviceEntries);
-                            context.Response.Headers.Add("Content-Type", "application/json");
+                            context.Response.Headers.Append("Content-Type", "application/json");
                             await context.Response.WriteAsync(json);
                         }
                     });
diff --git a/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs b/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs
index 2b8827c6a..b59c0bb68 100644
--- a/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs
+++ b/test/Ocelot.UnitTests/Errors/ExceptionHandlerMiddlewareTests.cs
@@ -102,7 +102,7 @@ public void should_throw_exception_if_config_provider_throws()
 
         private void WhenICallTheMiddlewareWithTheRequestIdKey(string key, string value)
         {
-            _httpContext.Request.Headers.Add(key, value);
+            _httpContext.Request.Headers.Append(key, value);
             /*
             _httpContext.Setup(x => x.Request.Headers).Returns(new HeaderDictionary() { { key, value } });
             */
diff --git a/test/Ocelot.UnitTests/Headers/AddHeadersToRequestPlainTests.cs b/test/Ocelot.UnitTests/Headers/AddHeadersToRequestPlainTests.cs
index d0236ad61..86eec01f0 100644
--- a/test/Ocelot.UnitTests/Headers/AddHeadersToRequestPlainTests.cs
+++ b/test/Ocelot.UnitTests/Headers/AddHeadersToRequestPlainTests.cs
@@ -79,17 +79,10 @@ private void GivenHttpRequestWithoutHeaders()
         }
 
         private void GivenHttpRequestWithHeader(string headerKey, string headerValue)
-        {
-            _context = new DefaultHttpContext
-            {
-                Request =
-                {
-                    Headers =
-                    {
-                        { headerKey, headerValue },
-                    },
-                },
-            };
+        {
+            var context = new DefaultHttpContext();
+            context.Request.Headers.Append(headerKey, headerValue);
+            _context = context;
         }
 
         private void WhenAddingHeader(string headerKey, string headerValue)
diff --git a/test/Ocelot.UnitTests/Headers/HttpContextRequestHeaderReplacerTests.cs b/test/Ocelot.UnitTests/Headers/HttpContextRequestHeaderReplacerTests.cs
index 6bc8d6c40..51fe342b1 100644
--- a/test/Ocelot.UnitTests/Headers/HttpContextRequestHeaderReplacerTests.cs
+++ b/test/Ocelot.UnitTests/Headers/HttpContextRequestHeaderReplacerTests.cs
@@ -21,7 +21,7 @@ public HttpContextRequestHeaderReplacerTests()
         public void should_replace_headers()
         {
             var context = new DefaultHttpContext();
-            context.Request.Headers.Add("test", "test");
+            context.Request.Headers.Append("test", "test");
 
             var fAndRs = new List<HeaderFindAndReplace> { new("test", "test", "chiken", 0) };
 
@@ -36,7 +36,7 @@ public void should_replace_headers()
         public void should_not_replace_headers()
         {
             var context = new DefaultHttpContext();
-            context.Request.Headers.Add("test", "test");
+            context.Request.Headers.Append("test", "test");
 
             var fAndRs = new List<HeaderFindAndReplace>();
 
diff --git a/test/Ocelot.UnitTests/Headers/HttpHeadersTransformationMiddlewareTests.cs b/test/Ocelot.UnitTests/Headers/HttpHeadersTransformationMiddlewareTests.cs
index 41433df78..d9441462b 100644
--- a/test/Ocelot.UnitTests/Headers/HttpHeadersTransformationMiddlewareTests.cs
+++ b/test/Ocelot.UnitTests/Headers/HttpHeadersTransformationMiddlewareTests.cs
@@ -106,7 +106,7 @@ private void ThenTheIHttpResponseHeaderReplacerIsCalledCorrectly()
 
         private void GivenTheFollowingRequest()
         {
-            _httpContext.Request.Headers.Add("test", "test");
+            _httpContext.Request.Headers.Append("test", "test");
         }
     }
 }
diff --git a/test/Ocelot.UnitTests/Infrastructure/PlaceholdersTests.cs b/test/Ocelot.UnitTests/Infrastructure/PlaceholdersTests.cs
index c7f71723a..0b6dd1832 100644
--- a/test/Ocelot.UnitTests/Infrastructure/PlaceholdersTests.cs
+++ b/test/Ocelot.UnitTests/Infrastructure/PlaceholdersTests.cs
@@ -123,7 +123,7 @@ public void should_return_upstreamHost()
         {
             var upstreamHost = "UpstreamHostA";
             var httpContext = new DefaultHttpContext();
-            httpContext.Request.Headers.Add("Host", upstreamHost);
+            httpContext.Request.Headers.Append("Host", upstreamHost);
             _accessor.Setup(x => x.HttpContext).Returns(httpContext);
             var result = _placeholders.Get("{UpstreamHost}");
             result.Data.ShouldBe(upstreamHost);
diff --git a/test/Ocelot.UnitTests/Kubernetes/KubeServiceDiscoveryProviderTests.cs b/test/Ocelot.UnitTests/Kubernetes/KubeServiceDiscoveryProviderTests.cs
index 2e9fe7ab5..272128a95 100644
--- a/test/Ocelot.UnitTests/Kubernetes/KubeServiceDiscoveryProviderTests.cs
+++ b/test/Ocelot.UnitTests/Kubernetes/KubeServiceDiscoveryProviderTests.cs
@@ -128,7 +128,7 @@ private void GivenThereIsAFakeKubeServiceDiscoveryProvider(string url, string se
                             }
 
                             var json = JsonConvert.SerializeObject(_endpointEntries);
-                            context.Response.Headers.Add("Content-Type", "application/json");
+                            context.Response.Headers.Append("Content-Type", "application/json");
                             await context.Response.WriteAsync(json);
                         }
                     });
diff --git a/test/Ocelot.UnitTests/LoadBalancer/LeastConnectionTests.cs b/test/Ocelot.UnitTests/LoadBalancer/LeastConnectionTests.cs
index be5d367b2..2766f58ab 100644
--- a/test/Ocelot.UnitTests/LoadBalancer/LeastConnectionTests.cs
+++ b/test/Ocelot.UnitTests/LoadBalancer/LeastConnectionTests.cs
@@ -21,7 +21,7 @@ public LeastConnectionTests()
         }
 
         [Fact]
-        public void should_be_able_to_lease_and_release_concurrently()
+        public async Task should_be_able_to_lease_and_release_concurrently()
         {
             var serviceName = "products";
 
@@ -41,11 +41,11 @@ public void should_be_able_to_lease_and_release_concurrently()
                 tasks[i] = LeaseDelayAndRelease();
             }
 
-            Task.WaitAll(tasks);
+            await Task.WhenAll(tasks);
         }
 
         [Fact]
-        public void should_handle_service_returning_to_available()
+        public async Task should_handle_service_returning_to_available()
         {
             var serviceName = "products";
 
@@ -57,9 +57,9 @@ public void should_handle_service_returning_to_available()
 
             _leastConnection = new LeastConnection(() => Task.FromResult(availableServices), serviceName);
 
-            var hostAndPortOne = _leastConnection.Lease(_httpContext).Result;
+            var hostAndPortOne = await _leastConnection.Lease(_httpContext);
             hostAndPortOne.Data.DownstreamHost.ShouldBe("127.0.0.1");
-            var hostAndPortTwo = _leastConnection.Lease(_httpContext).Result;
+            var hostAndPortTwo = await _leastConnection.Lease(_httpContext);
             hostAndPortTwo.Data.DownstreamHost.ShouldBe("127.0.0.2");
             _leastConnection.Release(hostAndPortOne.Data);
             _leastConnection.Release(hostAndPortTwo.Data);
@@ -69,9 +69,9 @@ public void should_handle_service_returning_to_available()
                 new(serviceName, new ServiceHostAndPort("127.0.0.1", 80), string.Empty, string.Empty, Array.Empty<string>()),
             };
 
-            hostAndPortOne = _leastConnection.Lease(_httpContext).Result;
+            hostAndPortOne = await _leastConnection.Lease(_httpContext);
             hostAndPortOne.Data.DownstreamHost.ShouldBe("127.0.0.1");
-            hostAndPortTwo = _leastConnection.Lease(_httpContext).Result;
+            hostAndPortTwo = await _leastConnection.Lease(_httpContext);
             hostAndPortTwo.Data.DownstreamHost.ShouldBe("127.0.0.1");
             _leastConnection.Release(hostAndPortOne.Data);
             _leastConnection.Release(hostAndPortTwo.Data);
@@ -82,9 +82,9 @@ public void should_handle_service_returning_to_available()
                 new(serviceName, new ServiceHostAndPort("127.0.0.2", 80), string.Empty, string.Empty, Array.Empty<string>()),
             };
 
-            hostAndPortOne = _leastConnection.Lease(_httpContext).Result;
+            hostAndPortOne = await _leastConnection.Lease(_httpContext);
             hostAndPortOne.Data.DownstreamHost.ShouldBe("127.0.0.1");
-            hostAndPortTwo = _leastConnection.Lease(_httpContext).Result;
+            hostAndPortTwo = await _leastConnection.Lease(_httpContext);
             hostAndPortTwo.Data.DownstreamHost.ShouldBe("127.0.0.2");
             _leastConnection.Release(hostAndPortOne.Data);
             _leastConnection.Release(hostAndPortTwo.Data);
@@ -117,7 +117,7 @@ public void should_get_next_url()
         }
 
         [Fact]
-        public void should_serve_from_service_with_least_connections()
+        public async Task should_serve_from_service_with_least_connections()
         {
             var serviceName = "products";
 
@@ -131,21 +131,21 @@ public void should_serve_from_service_with_least_connections()
             _services = availableServices;
             _leastConnection = new LeastConnection(() => Task.FromResult(_services), serviceName);
 
-            var response = _leastConnection.Lease(_httpContext).Result;
+            var response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[0].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[1].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[2].HostAndPort.DownstreamHost);
         }
 
         [Fact]
-        public void should_build_connections_per_service()
+        public async Task should_build_connections_per_service()
         {
             var serviceName = "products";
 
@@ -158,25 +158,25 @@ public void should_build_connections_per_service()
             _services = availableServices;
             _leastConnection = new LeastConnection(() => Task.FromResult(_services), serviceName);
 
-            var response = _leastConnection.Lease(_httpContext).Result;
+            var response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[0].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[1].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[0].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[1].HostAndPort.DownstreamHost);
         }
 
         [Fact]
-        public void should_release_connection()
+        public async Task should_release_connection()
         {
             var serviceName = "products";
 
@@ -189,26 +189,26 @@ public void should_release_connection()
             _services = availableServices;
             _leastConnection = new LeastConnection(() => Task.FromResult(_services), serviceName);
 
-            var response = _leastConnection.Lease(_httpContext).Result;
+            var response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[0].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[1].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[0].HostAndPort.DownstreamHost);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[1].HostAndPort.DownstreamHost);
 
             //release this so 2 should have 1 connection and we should get 2 back as our next host and port
             _leastConnection.Release(availableServices[1].HostAndPort);
 
-            response = _leastConnection.Lease(_httpContext).Result;
+            response = await _leastConnection.Lease(_httpContext);
 
             response.Data.DownstreamHost.ShouldBe(availableServices[1].HostAndPort.DownstreamHost);
         }
diff --git a/test/Ocelot.UnitTests/LoadBalancer/RoundRobinTests.cs b/test/Ocelot.UnitTests/LoadBalancer/RoundRobinTests.cs
index a981467c2..78196c13e 100644
--- a/test/Ocelot.UnitTests/LoadBalancer/RoundRobinTests.cs
+++ b/test/Ocelot.UnitTests/LoadBalancer/RoundRobinTests.cs
@@ -39,17 +39,17 @@ public void should_get_next_address()
         }
 
         [Fact]
-        public void should_go_back_to_first_address_after_finished_last()
+        public async Task should_go_back_to_first_address_after_finished_last()
         {
             var stopWatch = Stopwatch.StartNew();
 
             while (stopWatch.ElapsedMilliseconds < 1000)
             {
-                var address = _roundRobin.Lease(_httpContext).Result;
+                var address = await _roundRobin.Lease(_httpContext);
                 address.Data.ShouldBe(_services[0].HostAndPort);
-                address = _roundRobin.Lease(_httpContext).Result;
+                address = await _roundRobin.Lease(_httpContext);
                 address.Data.ShouldBe(_services[1].HostAndPort);
-                address = _roundRobin.Lease(_httpContext).Result;
+                address = await _roundRobin.Lease(_httpContext);
                 address.Data.ShouldBe(_services[2].HostAndPort);
             }
         }
diff --git a/test/Ocelot.UnitTests/Multiplexing/MultiplexingMiddlewareTests.cs b/test/Ocelot.UnitTests/Multiplexing/MultiplexingMiddlewareTests.cs
index 6c844ccd9..a7e6d2cb2 100644
--- a/test/Ocelot.UnitTests/Multiplexing/MultiplexingMiddlewareTests.cs
+++ b/test/Ocelot.UnitTests/Multiplexing/MultiplexingMiddlewareTests.cs
@@ -13,24 +13,19 @@ public class MultiplexingMiddlewareTests
         private readonly MultiplexingMiddleware _middleware;
         private Ocelot.DownstreamRouteFinder.DownstreamRouteHolder _downstreamRoute;
         private int _count;
-        private readonly Mock<IResponseAggregator> _aggregator;
-        private readonly Mock<IResponseAggregatorFactory> _factory;
         private readonly HttpContext _httpContext;
-        private readonly RequestDelegate _next;
-        private readonly Mock<IOcelotLoggerFactory> _loggerFactory;
-        private readonly Mock<IOcelotLogger> _logger;
 
         public MultiplexingMiddlewareTests()
         {
             _httpContext = new DefaultHttpContext();
-            _factory = new Mock<IResponseAggregatorFactory>();
-            _aggregator = new Mock<IResponseAggregator>();
-            _factory.Setup(x => x.Get(It.IsAny<Route>())).Returns(_aggregator.Object);
-            _loggerFactory = new Mock<IOcelotLoggerFactory>();
-            _logger = new Mock<IOcelotLogger>();
-            _loggerFactory.Setup(x => x.CreateLogger<MultiplexingMiddleware>()).Returns(_logger.Object);
-            _next = context => Task.FromResult(_count++);
-            _middleware = new MultiplexingMiddleware(_next, _loggerFactory.Object, _factory.Object);
+            var factory = new Mock<IResponseAggregatorFactory>();
+            var aggregator = new Mock<IResponseAggregator>();
+            factory.Setup(x => x.Get(It.IsAny<Route>())).Returns(aggregator.Object);
+            var loggerFactory = new Mock<IOcelotLoggerFactory>();
+            var logger = new Mock<IOcelotLogger>();
+            loggerFactory.Setup(x => x.CreateLogger<MultiplexingMiddleware>()).Returns(logger.Object);
+            Task Next(HttpContext context) => Task.FromResult(_count++);
+            _middleware = new MultiplexingMiddleware(Next, loggerFactory.Object, factory.Object);
         }
 
         [Fact]
diff --git a/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj b/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
index 0c9fe46f7..c54b547a4 100644
--- a/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
+++ b/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
@@ -1,63 +1,56 @@
 ﻿<Project Sdk="Microsoft.NET.Sdk">
-
-	<PropertyGroup>
-		<VersionPrefix>0.0.0-dev</VersionPrefix>
-		<TargetFramework>net7.0</TargetFramework>
+  <PropertyGroup>
+    <VersionPrefix>0.0.0-dev</VersionPrefix>
+    <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
     <ImplicitUsings>disable</ImplicitUsings>
     <Nullable>disable</Nullable>
     <IsPackable>false</IsPackable>
     <IsTestProject>true</IsTestProject>
     <AssemblyName>Ocelot.UnitTests</AssemblyName>
-		<PackageId>Ocelot.UnitTests</PackageId>
-		<OutputType>Exe</OutputType>
-		<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
-		<RuntimeIdentifiers>osx.10.11-x64;osx.10.12-x64;win7-x64;win10-x64</RuntimeIdentifiers>
-		<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
-		<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
-		<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
-		<CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
-		<GenerateDocumentationFile>True</GenerateDocumentationFile>
+    <PackageId>Ocelot.UnitTests</PackageId>
+    <OutputType>Exe</OutputType>
+    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
+    <RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
+    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+    <CodeAnalysisRuleSet>..\..\codeanalysis.ruleset</CodeAnalysisRuleSet>
+    <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>1591</NoWarn>
   </PropertyGroup>
-
-	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-		<DebugType>full</DebugType>
-		<DebugSymbols>True</DebugSymbols>
-	</PropertyGroup>
-
-	<ItemGroup>
-		<Compile Remove="Kubernetes\KubeProviderFactoryTests.cs" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Kubernetes\Ocelot.Provider.Kubernetes.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Administration\Ocelot.Administration.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Cache.CacheManager\Ocelot.Cache.CacheManager.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Consul\Ocelot.Provider.Consul.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Eureka\Ocelot.Provider.Eureka.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Provider.Polly\Ocelot.Provider.Polly.csproj" />
-		<ProjectReference Include="..\..\src\Ocelot.Tracing.Butterfly\Ocelot.Tracing.Butterfly.csproj" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<None Update="appsettings.json">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-		<None Update="mycert.pfx">
-			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
-
-	<ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DebugType>full</DebugType>
+    <DebugSymbols>True</DebugSymbols>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Remove="Kubernetes\KubeProviderFactoryTests.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Kubernetes\Ocelot.Provider.Kubernetes.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Administration\Ocelot.Administration.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Cache.CacheManager\Ocelot.Cache.CacheManager.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Consul\Ocelot.Provider.Consul.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Eureka\Ocelot.Provider.Eureka.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Provider.Polly\Ocelot.Provider.Polly.csproj" />
+    <ProjectReference Include="..\..\src\Ocelot.Tracing.Butterfly\Ocelot.Tracing.Butterfly.csproj" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Update="appsettings.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Update="mycert.pfx">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
     <PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
-    <PackageReference Include="xunit" Version="2.5.0" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
+    <PackageReference Include="xunit" Version="2.6.1" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
@@ -65,30 +58,57 @@
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <PrivateAssets>all</PrivateAssets>
     </PackageReference>
-    <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
-		<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.5" />
-		<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
-			<PrivateAssets>all</PrivateAssets>
-		</PackageReference>
-		<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
-		<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
-		<PackageReference Include="Moq" Version="4.18.4" />
-		<PackageReference Include="Shouldly" Version="4.1.0" />
-		<PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
-		<PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
-		<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
-		<PackageReference Include="IdentityServer4" Version="4.1.2" />
-		<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.2.3" />
-		<PackageReference Include="Consul" Version="1.6.10.9" />
-		<PackageReference Include="CacheManager.Core" Version="2.0.0-beta-1629" />
-		<PackageReference Include="CacheManager.Microsoft.Extensions.Configuration" Version="2.0.0-beta-1629" />
-		<PackageReference Include="CacheManager.Microsoft.Extensions.Logging" Version="2.0.0-beta-1629" />
-		<PackageReference Include="Polly" Version="7.2.3" />
-		<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
-	</ItemGroup>
+    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
+    <PackageReference Include="Moq" Version="4.20.69" />
+    <PackageReference Include="Shouldly" Version="4.2.1" />
+    <PackageReference Include="TestStack.BDDfy" Version="4.3.2" />
+    <PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
+    <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
+    <PackageReference Include="IdentityServer4" Version="4.1.2" />
+    <PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.2.5" />
+    <PackageReference Include="Consul" Version="1.7.14.1" />
+    <PackageReference Include="CacheManager.Core" Version="2.0.0-beta-1629" />
+    <PackageReference Include="CacheManager.Microsoft.Extensions.Configuration" Version="2.0.0-beta-1629" />
+    <PackageReference Include="CacheManager.Microsoft.Extensions.Logging" Version="2.0.0-beta-1629" />
+    <PackageReference Include="Polly" Version="8.2.0" />
+    <PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 6.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.25" />
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 7.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.14" />
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
+  </ItemGroup>
+  <!-- Conditionally obtain references for the net 8.0 target -->
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
+  </ItemGroup>
 </Project>
diff --git a/test/Ocelot.UnitTests/Request/Mapper/RequestMapperTests.cs b/test/Ocelot.UnitTests/Request/Mapper/RequestMapperTests.cs
index ad93c9d4e..bd6c5a736 100644
--- a/test/Ocelot.UnitTests/Request/Mapper/RequestMapperTests.cs
+++ b/test/Ocelot.UnitTests/Request/Mapper/RequestMapperTests.cs
@@ -274,7 +274,7 @@ private void ThenTheMappedRequestHasContentDispositionHeader(string expected)
 
         private void GivenTheContentDispositionIs(string input)
         {
-            _inputRequest.Headers.Add("Content-Disposition", input);
+            _inputRequest.Headers.Append("Content-Disposition", input);
         }
 
         private void ThenTheMappedRequestHasContentMD5Header(byte[] expected)
@@ -285,7 +285,7 @@ private void ThenTheMappedRequestHasContentMD5Header(byte[] expected)
         private void GivenTheContentMD5Is(byte[] input)
         {
             var base64 = Convert.ToBase64String(input);
-            _inputRequest.Headers.Add("Content-MD5", base64);
+            _inputRequest.Headers.Append("Content-MD5", base64);
         }
 
         private void ThenTheMappedRequestHasContentRangeHeader()
@@ -296,7 +296,7 @@ private void ThenTheMappedRequestHasContentRangeHeader()
 
         private void GivenTheContentRangeIs(string input)
         {
-            _inputRequest.Headers.Add("Content-Range", input);
+            _inputRequest.Headers.Append("Content-Range", input);
         }
 
         private void ThenTheMappedRequestHasContentLocationHeader(string expected)
@@ -306,7 +306,7 @@ private void ThenTheMappedRequestHasContentLocationHeader(string expected)
 
         private void GivenTheContentLocationIs(string input)
         {
-            _inputRequest.Headers.Add("Content-Location", input);
+            _inputRequest.Headers.Append("Content-Location", input);
         }
 
         private void ThenTheMappedRequestHasContentLanguageHeader(string expected)
@@ -316,7 +316,7 @@ private void ThenTheMappedRequestHasContentLanguageHeader(string expected)
 
         private void GivenTheContentLanguageIs(string input)
         {
-            _inputRequest.Headers.Add("Content-Language", input);
+            _inputRequest.Headers.Append("Content-Language", input);
         }
 
         private void ThenTheMappedRequestHasContentEncodingHeader(string expected, string expectedTwo)
@@ -327,7 +327,7 @@ private void ThenTheMappedRequestHasContentEncodingHeader(string expected, strin
 
         private void GivenTheContentEncodingIs(string input)
         {
-            _inputRequest.Headers.Add("Content-Encoding", input);
+            _inputRequest.Headers.Append("Content-Encoding", input);
         }
 
         private void GivenTheContentTypeIs(string contentType)
diff --git a/test/Ocelot.UnitTests/RequestId/RequestIdMiddlewareTests.cs b/test/Ocelot.UnitTests/RequestId/RequestIdMiddlewareTests.cs
index 54b223c2c..641f9c9cc 100644
--- a/test/Ocelot.UnitTests/RequestId/RequestIdMiddlewareTests.cs
+++ b/test/Ocelot.UnitTests/RequestId/RequestIdMiddlewareTests.cs
@@ -32,7 +32,7 @@ public RequestIdMiddlewareTests()
             _loggerFactory.Setup(x => x.CreateLogger<RequestIdMiddleware>()).Returns(_logger.Object);
             _next = context =>
             {
-                _httpContext.Response.Headers.Add("LSRequestId", _httpContext.TraceIdentifier);
+                _httpContext.Response.Headers.Append("LSRequestId", _httpContext.TraceIdentifier);
                 return Task.CompletedTask;
             };
             _middleware = new RequestIdMiddleware(_next, _loggerFactory.Object, _repo.Object);
diff --git a/test/Ocelot.UnitTests/Responder/HttpContextResponderTests.cs b/test/Ocelot.UnitTests/Responder/HttpContextResponderTests.cs
index 523e1a483..3e273bf85 100644
--- a/test/Ocelot.UnitTests/Responder/HttpContextResponderTests.cs
+++ b/test/Ocelot.UnitTests/Responder/HttpContextResponderTests.cs
@@ -9,16 +9,15 @@ namespace Ocelot.UnitTests.Responder
     public class HttpContextResponderTests
     {
         private readonly HttpContextResponder _responder;
-        private readonly RemoveOutputHeaders _removeOutputHeaders;
 
         public HttpContextResponderTests()
         {
-            _removeOutputHeaders = new RemoveOutputHeaders();
-            _responder = new HttpContextResponder(_removeOutputHeaders);
+            var removeOutputHeaders = new RemoveOutputHeaders();
+            _responder = new HttpContextResponder(removeOutputHeaders);
         }
 
         [Fact]
-        public void should_remove_transfer_encoding_header()
+        public async Task should_remove_transfer_encoding_header()
         {
             var httpContext = new DefaultHttpContext();
             var response = new DownstreamResponse(new StringContent(string.Empty), HttpStatusCode.OK,
@@ -27,42 +26,38 @@ public void should_remove_transfer_encoding_header()
                     new("Transfer-Encoding", new List<string> {"woop"}),
                 }, "some reason");
 
-            _responder.SetResponseOnHttpContext(httpContext, response).GetAwaiter().GetResult();
+            await _responder.SetResponseOnHttpContext(httpContext, response);
             var header = httpContext.Response.Headers["Transfer-Encoding"];
             header.ShouldBeEmpty();
         }
 
         [Fact]
-        public void should_ignore_content_if_null()
+        public async Task should_ignore_content_if_null()
         {
             var httpContext = new DefaultHttpContext();
             var response = new DownstreamResponse(null, HttpStatusCode.OK,
                 new List<KeyValuePair<string, IEnumerable<string>>>(), "some reason");
 
-            Should.NotThrow(() =>
+            await Should.NotThrowAsync(async () =>
             {
-                _responder
-                    .SetResponseOnHttpContext(httpContext, response)
-                    .GetAwaiter()
-                    .GetResult()
-                ;
+                await _responder.SetResponseOnHttpContext(httpContext, response);
             });
         }
 
         [Fact]
-        public void should_have_content_length()
+        public async Task should_have_content_length()
         {
             var httpContext = new DefaultHttpContext();
             var response = new DownstreamResponse(new StringContent("test"), HttpStatusCode.OK,
                 new List<KeyValuePair<string, IEnumerable<string>>>(), "some reason");
 
-            _responder.SetResponseOnHttpContext(httpContext, response).GetAwaiter().GetResult();
+            await _responder.SetResponseOnHttpContext(httpContext, response);
             var header = httpContext.Response.Headers["Content-Length"];
             header.First().ShouldBe("4");
         }
 
         [Fact]
-        public void should_add_header()
+        public async Task should_add_header()
         {
             var httpContext = new DefaultHttpContext();
             var response = new DownstreamResponse(new StringContent(string.Empty), HttpStatusCode.OK,
@@ -71,13 +66,13 @@ public void should_add_header()
                     new("test", new List<string> {"test"}),
                 }, "some reason");
 
-            _responder.SetResponseOnHttpContext(httpContext, response).GetAwaiter().GetResult();
+            await _responder.SetResponseOnHttpContext(httpContext, response);
             var header = httpContext.Response.Headers["test"];
             header.First().ShouldBe("test");
         }
 
         [Fact]
-        public void should_add_reason_phrase()
+        public async Task should_add_reason_phrase()
         {
             var httpContext = new DefaultHttpContext();
             var response = new DownstreamResponse(new StringContent(string.Empty), HttpStatusCode.OK,
@@ -86,7 +81,7 @@ public void should_add_reason_phrase()
                     new("test", new List<string> {"test"}),
                 }, "some reason");
 
-            _responder.SetResponseOnHttpContext(httpContext, response).GetAwaiter().GetResult();
+            await _responder.SetResponseOnHttpContext(httpContext, response);
             httpContext.Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase.ShouldBe(response.ReasonPhrase);
         }