From 57d5b664d35fbb13f1ebec74fa45272b8183e623 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Thu, 6 Mar 2025 18:44:15 +0100 Subject: [PATCH] [.NET] Skip re-saving `.csproj` when TFM is unchanged Avoids updating the platform-specific `TargetFramework` properties if they already match the minimum required version. --- .../GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs index 7a07e0a9753..22420e2b63c 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs @@ -191,6 +191,13 @@ namespace GodotTools.ProjectEditor // Otherwise, it can be removed. if (mainTfmVersion > minTfmVersion) { + var propertyTfmVersion = NuGetFramework.Parse(property.Value).Version; + if (propertyTfmVersion == minTfmVersion) + { + // The 'TargetFramework' property already matches the minimum version. + continue; + } + property.Value = minTfmValue; } else