From 48cbb294b7b1d659d776731c2c3b70b18c145626 Mon Sep 17 00:00:00 2001 From: Amir Date: Fri, 23 Feb 2024 02:50:30 +0330 Subject: [PATCH] Add regex evaluation timeout (#404) --- src/xunit.runner.visualstudio/Utility/RunSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xunit.runner.visualstudio/Utility/RunSettings.cs b/src/xunit.runner.visualstudio/Utility/RunSettings.cs index 7776396..2e3593f 100644 --- a/src/xunit.runner.visualstudio/Utility/RunSettings.cs +++ b/src/xunit.runner.visualstudio/Utility/RunSettings.cs @@ -233,7 +233,7 @@ public bool IsMatchingTargetFramework() } // This should match .NET versions like 'net6.0' but not .NET Framework version like 'net462'. - static readonly Regex regexNet5Plus = new(@"^net\d+\.\d+$"); + static readonly Regex regexNet5Plus = new(@"^net\d+\.\d+$", RegexOptions.Multiline | RegexOptions.Compiled | RegexOptions.IgnoreCase, TimeSpan.FromSeconds(1)); static bool IsNetCore(string targetFrameworkVersion) => targetFrameworkVersion.StartsWith(".NETCoreApp,", StringComparison.OrdinalIgnoreCase) ||