From 256ef820cb7cdad57671c94443918afcf5c64745 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Mon, 16 Nov 2026 09:07:49 -0500 Subject: [PATCH 1/4] Keep default RollForward for local development --- src/Custom.Build.props | 2 +- .../DeploymentPackageTests.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Custom.Build.props b/src/Custom.Build.props index 45ddca79e7..07465268fb 100644 --- a/src/Custom.Build.props +++ b/src/Custom.Build.props @@ -13,7 +13,7 @@ 10.0.15 - Disable + Disable diff --git a/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs b/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs index 9f6f19af1c..6b6fff9a8d 100644 --- a/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs +++ b/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs @@ -48,6 +48,7 @@ public void DuplicateAssembliesInDeploymentUnitsShouldHaveMatchingVersions() Assert.That(detectedMismatches, Is.Empty, $"Component assembly version mismatch detected"); } + // This test will fail if you are not using the exact runtime version specified in the RuntimeFrameworkVersion property in the Custom.Build.props file [Test] public void DuplicateAssembliesFromRuntimeShouldHaveMatchingVersions() { @@ -64,6 +65,7 @@ public void DuplicateAssembliesFromRuntimeShouldHaveMatchingVersions() Assert.That(detectedMismatches, Is.Empty, $"Component assembly version mismatch detected"); } + // This test will fail if you are not using the exact runtime version specified in the RuntimeFrameworkVersion property in the Custom.Build.props file [Test] public void DuplicateAssembliesFromASPNetCoreShouldHaveMatchingVersions() { From 13834f6f6c5e12ab82bb11a996535da8f7e98bf3 Mon Sep 17 00:00:00 2001 From: Rhys Bevilaqua Date: Tue, 17 Nov 2026 09:47:03 +0800 Subject: [PATCH 2/4] Expose the expected runtime mismatch in the test failure message --- .../DeploymentPackageTests.cs | 20 +++++++++++++++++-- ...ontrolInstaller.Packaging.UnitTests.csproj | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs b/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs index 6b6fff9a8d..d1a8cfa77f 100644 --- a/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs +++ b/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs @@ -1,9 +1,11 @@ namespace Tests { + using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; + using System.Reflection; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Http; using NUnit.Framework; @@ -62,7 +64,14 @@ public void DuplicateAssembliesFromRuntimeShouldHaveMatchingVersions() detectedMismatches.AddRange(GetAssemblyMismatches(deploymentUnit, runtimeDeploymentUnit)); } - Assert.That(detectedMismatches, Is.Empty, $"Component assembly version mismatch detected"); + var expectedVersion = typeof(DeploymentPackageTests).Assembly + .GetCustomAttributes() + .Single(a => a.Key == "RuntimeFrameworkVersion").Value; + var runtimeMessage = Environment.Version > Version.Parse(expectedVersion) + ? $" Runtime rolled forward from requested {expectedVersion} to {Environment.Version}. This test requires the exact runtime version specified in Custom.Build.props." + : $" Requested runtime: {expectedVersion}; running runtime: {Environment.Version}."; + + Assert.That(detectedMismatches, Is.Empty, $"Component assembly version mismatch detected.{runtimeMessage}"); } // This test will fail if you are not using the exact runtime version specified in the RuntimeFrameworkVersion property in the Custom.Build.props file @@ -79,7 +88,14 @@ public void DuplicateAssembliesFromASPNetCoreShouldHaveMatchingVersions() detectedMismatches.AddRange(GetAssemblyMismatches(deploymentUnit, aspNetCoreDeploymentUnit)); } - Assert.That(detectedMismatches, Is.Empty, $"Component assembly version mismatch detected"); + var expectedVersion = typeof(DeploymentPackageTests).Assembly + .GetCustomAttributes() + .Single(a => a.Key == "RuntimeFrameworkVersion").Value; + var runtimeMessage = Version.Parse(aspNetCoreDirectory.Name) > Version.Parse(expectedVersion) + ? $" ASP.NET Core runtime rolled forward from requested {expectedVersion} to {aspNetCoreDirectory.Name}. This test requires the exact runtime version specified in Custom.Build.props." + : $" Requested ASP.NET Core runtime: {expectedVersion}; running runtime: {aspNetCoreDirectory.Name}."; + + Assert.That(detectedMismatches, Is.Empty, $"Component assembly version mismatch detected.{runtimeMessage}"); } IEnumerable GetAssemblyMismatches(DeploymentPackage.DeploymentUnit leftDeploymentUnit, DeploymentPackage.DeploymentUnit rightDeploymentUnit) diff --git a/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj b/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj index 38dd4fbc7d..57c24b4de1 100644 --- a/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj +++ b/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj @@ -7,6 +7,7 @@ + From f3ed634e4d6265893c3e7dd6f85740dc3a7146fa Mon Sep 17 00:00:00 2001 From: Rhys Bevilaqua Date: Tue, 17 Nov 2026 09:49:53 +0800 Subject: [PATCH 3/4] Split up itemgroups --- .../ServiceControlInstaller.Packaging.UnitTests.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj b/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj index 57c24b4de1..1d4d89351f 100644 --- a/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj +++ b/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj @@ -7,6 +7,9 @@ + + + From 4c3657eeedfc84c71e243dfec4948defec869c89 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Tue, 17 Nov 2026 11:04:41 -0500 Subject: [PATCH 4/4] Tweak formatting --- .../DeploymentPackageTests.cs | 2 ++ .../ServiceControlInstaller.Packaging.UnitTests.csproj | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs b/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs index d1a8cfa77f..9ca885c014 100644 --- a/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs +++ b/src/ServiceControlInstaller.Packaging.UnitTests/DeploymentPackageTests.cs @@ -67,6 +67,7 @@ public void DuplicateAssembliesFromRuntimeShouldHaveMatchingVersions() var expectedVersion = typeof(DeploymentPackageTests).Assembly .GetCustomAttributes() .Single(a => a.Key == "RuntimeFrameworkVersion").Value; + var runtimeMessage = Environment.Version > Version.Parse(expectedVersion) ? $" Runtime rolled forward from requested {expectedVersion} to {Environment.Version}. This test requires the exact runtime version specified in Custom.Build.props." : $" Requested runtime: {expectedVersion}; running runtime: {Environment.Version}."; @@ -91,6 +92,7 @@ public void DuplicateAssembliesFromASPNetCoreShouldHaveMatchingVersions() var expectedVersion = typeof(DeploymentPackageTests).Assembly .GetCustomAttributes() .Single(a => a.Key == "RuntimeFrameworkVersion").Value; + var runtimeMessage = Version.Parse(aspNetCoreDirectory.Name) > Version.Parse(expectedVersion) ? $" ASP.NET Core runtime rolled forward from requested {expectedVersion} to {aspNetCoreDirectory.Name}. This test requires the exact runtime version specified in Custom.Build.props." : $" Requested ASP.NET Core runtime: {expectedVersion}; running runtime: {aspNetCoreDirectory.Name}."; diff --git a/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj b/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj index 1d4d89351f..0bee0f8fc8 100644 --- a/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj +++ b/src/ServiceControlInstaller.Packaging.UnitTests/ServiceControlInstaller.Packaging.UnitTests.csproj @@ -9,10 +9,6 @@ - - - - @@ -29,4 +25,8 @@ + + + +