diff --git a/eng/docker/build-docker-sdk.ps1 b/eng/docker/build-docker-sdk.ps1
index bc73312efcb6c..1a09343defbf6 100755
--- a/eng/docker/build-docker-sdk.ps1
+++ b/eng/docker/build-docker-sdk.ps1
@@ -36,6 +36,7 @@ if ($buildWindowsContainers)
# 2. Runtime pack (microsoft.netcore.app.runtime.win-x64)
# 3. targetingpacks.targets, so stress test builds can target the live-built runtime instead of the one in the pre-installed SDK
# 4. testhost
+ # 5. msquic interop sources (needed for HttpStress)
$binArtifacts = "$REPO_ROOT_DIR\artifacts\bin"
$dockerContext = "$REPO_ROOT_DIR\artifacts\docker-context"
@@ -51,6 +52,8 @@ if ($buildWindowsContainers)
-Destination $dockerContext\testhost
Copy-Item -Recurse -Path $REPO_ROOT_DIR\eng\targetingpacks.targets `
-Destination $dockerContext\targetingpacks.targets
+ Copy-Item -Recurse -Path $REPO_ROOT_DIR\src\libraries\System.Net.Quic\src\System\Net\Quic\Interop `
+ -Destination $dockerContext\msquic-interop
# In case of non-CI builds, testhost may already contain Microsoft.AspNetCore.App (see build-local.ps1 in HttpStress):
$testHostAspNetCorePath="$dockerContext\testhost\net$dotNetVersion-windows-$configuration-x64/shared/Microsoft.AspNetCore.App"
diff --git a/eng/docker/libraries-sdk.linux.Dockerfile b/eng/docker/libraries-sdk.linux.Dockerfile
index 8d7d6169a9fe9..401ce9f1ffd43 100644
--- a/eng/docker/libraries-sdk.linux.Dockerfile
+++ b/eng/docker/libraries-sdk.linux.Dockerfile
@@ -26,6 +26,7 @@ RUN bash ./dotnet-install.sh --channel $_DOTNET_INSTALL_CHANNEL --quality daily
# 2. Runtime pack (microsoft.netcore.app.runtime.linux-x64)
# 3. targetingpacks.targets, so stress test builds can target the live-built runtime instead of the one in the pre-installed SDK
# 4. testhost
+# 5. msquic interop sources (needed for HttpStress)
COPY --from=corefxbuild \
/repo/artifacts/bin/microsoft.netcore.app.ref \
@@ -43,6 +44,10 @@ COPY --from=corefxbuild \
/repo/artifacts/bin/testhost \
/live-runtime-artifacts/testhost
+COPY --from=corefxbuild \
+ /repo/src/libraries/System.Net.Quic/src/System/Net/Quic/Interop \
+ /live-runtime-artifacts/msquic-interop
+
# Add AspNetCore bits to testhost:
ENV _ASPNETCORE_SOURCE="/usr/share/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*"
ENV _ASPNETCORE_DEST="/live-runtime-artifacts/testhost/net$VERSION-linux-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App"
diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.props b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.props
index 509bca64fdc3d..3ee8cbfa7ae05 100644
--- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.props
+++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.props
@@ -5,7 +5,8 @@
$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/
-
+
+ $(RepositoryRoot)src/libraries/System.Net.Quic/src/System/Net/Quic/Interop/*.cs
$(RepositoryRoot)eng/targetingpacks.targets
8.0.0
net8.0
@@ -14,4 +15,4 @@
$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.ref/
$(RepositoryRoot)artifacts/bin/microsoft.netcore.app.runtime.$(OutputRID)/$(Configuration)/
-
\ No newline at end of file
+
diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile
index e56f8c80c3212..6dc83bce1895e 100644
--- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile
+++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile
@@ -28,6 +28,7 @@ WORKDIR /app
COPY . .
RUN dotnet build -c $CONFIGURATION \
+ -p:MsQuicInteropIncludes="/live-runtime-artifacts/msquic-interop/*.cs" \
-p:TargetingPacksTargetsLocation=/live-runtime-artifacts/targetingpacks.targets \
-p:MicrosoftNetCoreAppRefPackDir=/live-runtime-artifacts/microsoft.netcore.app.ref/ \
-p:MicrosoftNetCoreAppRuntimePackDir=/live-runtime-artifacts/microsoft.netcore.app.runtime.linux-x64/$CONFIGURATION/
diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj
index bb71d66d214c2..b98a4bd529c76 100644
--- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj
+++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj
@@ -4,6 +4,8 @@
$(NetCoreAppCurrent)
enable
True
+ CA2252
+ true
@@ -15,6 +17,11 @@
+
+
+
+
+
false
diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs
index a1a2769273591..5a60db6364aad 100644
--- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs
+++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs
@@ -13,6 +13,8 @@
using System.Threading.Tasks;
using System.Net;
using HttpStress;
+using System.Net.Quic;
+using Microsoft.Quic;
[assembly:SupportedOSPlatform("windows")]
[assembly:SupportedOSPlatform("linux")]
@@ -26,6 +28,8 @@ public static class Program
{
public enum ExitCode { Success = 0, StressError = 1, CliError = 2 };
+ public static readonly bool IsQuicSupported = QuicListener.IsSupported && QuicConnection.IsSupported;
+
public static async Task Main(string[] args)
{
if (!TryParseCli(args, out Configuration? config))
@@ -158,6 +162,9 @@ private static async Task Run(Configuration config)
string GetAssemblyInfo(Assembly assembly) => $"{assembly.Location}, modified {new FileInfo(assembly.Location).LastWriteTime}";
+ Type msQuicApiType = typeof(QuicConnection).Assembly.GetType("System.Net.Quic.MsQuicApi");
+ string msQuicLibraryVersion = (string)msQuicApiType.GetProperty("MsQuicLibraryVersion", BindingFlags.NonPublic | BindingFlags.Static).GetGetMethod(true).Invoke(null, Array.Empty