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

Avoids updating the platform-specific `TargetFramework` properties if they already match the minimum required version.
This commit is contained in:
Raul Santos 2025-03-06 18:44:15 +01:00
parent 9f68a81659
commit 57d5b664d3
No known key found for this signature in database
GPG key ID: B532473AE3A803E4

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