From 9e9fd58cbe6953676347c390e143945216cf8bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Sun, 22 Dec 2024 10:21:36 -0500 Subject: [PATCH] Update tfm --- common/SharedHttpClient.cs | 2 +- eng/validate-testprojects-configuration.ps1 | 4 ++++ .../Meziantou.Framework.ByteSize.Tests.csproj | 4 ++-- .../Meziantou.Framework.CodeOwners.Tests.csproj | 4 ++-- .../Meziantou.Framework.RelativeDate.Tests.csproj | 2 +- .../Meziantou.Framework.SingleInstance.Tests.csproj | 2 +- .../Meziantou.Framework.ValueStopwatch.Tests.csproj | 4 ++-- .../Meziantou.Framework.Versioning.Tests.csproj | 2 +- .../Meziantou.Framework.WPF.Tests.csproj | 4 ++-- ...eziantou.Framework.Win32.CredentialManager.Tests.csproj | 2 +- .../Meziantou.Framework.Win32.RestartManager.Tests.csproj | 2 +- .../RestartManagerTests.cs | 2 +- tests/TestUtilities/NuGetHelpers.cs | 6 +++--- tests/TestUtilities/TestUtilities.csproj | 7 ++++++- 14 files changed, 28 insertions(+), 19 deletions(-) diff --git a/common/SharedHttpClient.cs b/common/SharedHttpClient.cs index cb5bc3bdc..2309d0835 100644 --- a/common/SharedHttpClient.cs +++ b/common/SharedHttpClient.cs @@ -1,4 +1,4 @@ -#if NET462 +#if NET462 || NET472 using System.Net.Http; #endif diff --git a/eng/validate-testprojects-configuration.ps1 b/eng/validate-testprojects-configuration.ps1 index 697dca25f..b13bc02a7 100644 --- a/eng/validate-testprojects-configuration.ps1 +++ b/eng/validate-testprojects-configuration.ps1 @@ -42,6 +42,10 @@ $Errors = $Projs | Foreach-Object -ThrottleLimit 5 -Parallel { if ($RefTfm -eq "netstandard2.1") { continue; } + + if ($RefTfm -eq "net462" -and $TestProjectTfms.Contains("net472")) { + continue; + } if (-not $TestProjectTfms.Contains($RefTfm)) { Write-Error "Project $($Proj.FullName) does not target $RefTfm, but it references $RefProj which does. ($TestProjectTfms) != ($RefTfms)" diff --git a/tests/Meziantou.Framework.ByteSize.Tests/Meziantou.Framework.ByteSize.Tests.csproj b/tests/Meziantou.Framework.ByteSize.Tests/Meziantou.Framework.ByteSize.Tests.csproj index 1671a9583..0b907c9c4 100644 --- a/tests/Meziantou.Framework.ByteSize.Tests/Meziantou.Framework.ByteSize.Tests.csproj +++ b/tests/Meziantou.Framework.ByteSize.Tests/Meziantou.Framework.ByteSize.Tests.csproj @@ -1,8 +1,8 @@ - + $(LatestTargetFrameworks) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.CodeOwners.Tests/Meziantou.Framework.CodeOwners.Tests.csproj b/tests/Meziantou.Framework.CodeOwners.Tests/Meziantou.Framework.CodeOwners.Tests.csproj index e9a770a1c..6efaeca0d 100644 --- a/tests/Meziantou.Framework.CodeOwners.Tests/Meziantou.Framework.CodeOwners.Tests.csproj +++ b/tests/Meziantou.Framework.CodeOwners.Tests/Meziantou.Framework.CodeOwners.Tests.csproj @@ -1,8 +1,8 @@ - + $(LatestTargetFrameworks) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.RelativeDate.Tests/Meziantou.Framework.RelativeDate.Tests.csproj b/tests/Meziantou.Framework.RelativeDate.Tests/Meziantou.Framework.RelativeDate.Tests.csproj index d874577e0..6c2d12a91 100644 --- a/tests/Meziantou.Framework.RelativeDate.Tests/Meziantou.Framework.RelativeDate.Tests.csproj +++ b/tests/Meziantou.Framework.RelativeDate.Tests/Meziantou.Framework.RelativeDate.Tests.csproj @@ -2,7 +2,7 @@ $(LatestTargetFrameworks) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.SingleInstance.Tests/Meziantou.Framework.SingleInstance.Tests.csproj b/tests/Meziantou.Framework.SingleInstance.Tests/Meziantou.Framework.SingleInstance.Tests.csproj index 3abf00173..5c20d0677 100644 --- a/tests/Meziantou.Framework.SingleInstance.Tests/Meziantou.Framework.SingleInstance.Tests.csproj +++ b/tests/Meziantou.Framework.SingleInstance.Tests/Meziantou.Framework.SingleInstance.Tests.csproj @@ -2,7 +2,7 @@ $(LatestTargetFrameworks) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.ValueStopwatch.Tests/Meziantou.Framework.ValueStopwatch.Tests.csproj b/tests/Meziantou.Framework.ValueStopwatch.Tests/Meziantou.Framework.ValueStopwatch.Tests.csproj index 2039615e8..49f4ebc3e 100644 --- a/tests/Meziantou.Framework.ValueStopwatch.Tests/Meziantou.Framework.ValueStopwatch.Tests.csproj +++ b/tests/Meziantou.Framework.ValueStopwatch.Tests/Meziantou.Framework.ValueStopwatch.Tests.csproj @@ -1,8 +1,8 @@ - + $(LatestTargetFrameworks) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.Versioning.Tests/Meziantou.Framework.Versioning.Tests.csproj b/tests/Meziantou.Framework.Versioning.Tests/Meziantou.Framework.Versioning.Tests.csproj index e50ee91b6..1205ad7e1 100644 --- a/tests/Meziantou.Framework.Versioning.Tests/Meziantou.Framework.Versioning.Tests.csproj +++ b/tests/Meziantou.Framework.Versioning.Tests/Meziantou.Framework.Versioning.Tests.csproj @@ -2,7 +2,7 @@ $(LatestTargetFrameworks) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.WPF.Tests/Meziantou.Framework.WPF.Tests.csproj b/tests/Meziantou.Framework.WPF.Tests/Meziantou.Framework.WPF.Tests.csproj index e3af819b1..c72a3227d 100644 --- a/tests/Meziantou.Framework.WPF.Tests/Meziantou.Framework.WPF.Tests.csproj +++ b/tests/Meziantou.Framework.WPF.Tests/Meziantou.Framework.WPF.Tests.csproj @@ -2,12 +2,12 @@ $(LatestTargetFrameworksWindows) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 true true - + diff --git a/tests/Meziantou.Framework.Win32.CredentialManager.Tests/Meziantou.Framework.Win32.CredentialManager.Tests.csproj b/tests/Meziantou.Framework.Win32.CredentialManager.Tests/Meziantou.Framework.Win32.CredentialManager.Tests.csproj index 8fd2693bd..e8ce8aa2a 100644 --- a/tests/Meziantou.Framework.Win32.CredentialManager.Tests/Meziantou.Framework.Win32.CredentialManager.Tests.csproj +++ b/tests/Meziantou.Framework.Win32.CredentialManager.Tests/Meziantou.Framework.Win32.CredentialManager.Tests.csproj @@ -2,7 +2,7 @@ $(LatestTargetFrameworksWindows) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.Win32.RestartManager.Tests/Meziantou.Framework.Win32.RestartManager.Tests.csproj b/tests/Meziantou.Framework.Win32.RestartManager.Tests/Meziantou.Framework.Win32.RestartManager.Tests.csproj index 977f7d79c..0e6303aba 100644 --- a/tests/Meziantou.Framework.Win32.RestartManager.Tests/Meziantou.Framework.Win32.RestartManager.Tests.csproj +++ b/tests/Meziantou.Framework.Win32.RestartManager.Tests/Meziantou.Framework.Win32.RestartManager.Tests.csproj @@ -2,7 +2,7 @@ $(LatestTargetFrameworksWindows) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 diff --git a/tests/Meziantou.Framework.Win32.RestartManager.Tests/RestartManagerTests.cs b/tests/Meziantou.Framework.Win32.RestartManager.Tests/RestartManagerTests.cs index c3626d1ee..56987fa15 100644 --- a/tests/Meziantou.Framework.Win32.RestartManager.Tests/RestartManagerTests.cs +++ b/tests/Meziantou.Framework.Win32.RestartManager.Tests/RestartManagerTests.cs @@ -9,7 +9,7 @@ public class RestartManagerTests public RestartManagerTests() { -#if NET462 +#if NET462 || NET472 _currentProcessId = System.Diagnostics.Process.GetCurrentProcess().Id; #else _currentProcessId = System.Environment.ProcessId; diff --git a/tests/TestUtilities/NuGetHelpers.cs b/tests/TestUtilities/NuGetHelpers.cs index 0f19f9fd1..ca3ca0e88 100644 --- a/tests/TestUtilities/NuGetHelpers.cs +++ b/tests/TestUtilities/NuGetHelpers.cs @@ -1,4 +1,4 @@ -#if !NET462 +#if !NET462 && !NET472 #pragma warning disable MA0042 #endif using System.Collections.Concurrent; @@ -10,7 +10,7 @@ using Meziantou.Framework; using Xunit; -#if NET462 +#if NET462 || NET472 using System.Net.Http; #endif @@ -20,7 +20,7 @@ public static class NuGetHelpers { private static readonly ConcurrentDictionary>> NuGetPackagesCache = new(StringComparer.Ordinal); -#if !NET462 +#if !NET462 && !NET472 [SuppressMessage("Performance", "MA0106:Avoid closure by using an overload with the 'factoryArgument' parameter", Justification = "Not important in tests")] #endif public static async Task GetNuGetReferences(string packageName, string version, params string[] paths) diff --git a/tests/TestUtilities/TestUtilities.csproj b/tests/TestUtilities/TestUtilities.csproj index f2f5eb97f..339583564 100644 --- a/tests/TestUtilities/TestUtilities.csproj +++ b/tests/TestUtilities/TestUtilities.csproj @@ -2,7 +2,7 @@ $(LatestTargetFrameworks) - $(TargetFrameworks);net462 + $(TargetFrameworks);net472 @@ -15,4 +15,9 @@ + + + + +