[.NET] Skip re-saving .csproj when TFM is unchanged

Avoids updating the platform-specific `TargetFramework` properties if they already match the minimum required version.

(cherry picked from commit 57d5b664d3)
This commit is contained in:
Raul Santos
2025-03-06 18:44:15 +01:00
committed by Rémi Verschelde
parent 40e3cec9e0
commit 10b2b76347

View File

@ -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