Skip to content

Commit 57d5b66

Browse files
committed
[.NET] Skip re-saving .csproj when TFM is unchanged
Avoids updating the platform-specific `TargetFramework` properties if they already match the minimum required version.
1 parent 9f68a81 commit 57d5b66

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ private static void EnsureTargetFrameworkMatchesMinimumRequirement(MSBuildProjec
191191
// Otherwise, it can be removed.
192192
if (mainTfmVersion > minTfmVersion)
193193
{
194+
var propertyTfmVersion = NuGetFramework.Parse(property.Value).Version;
195+
if (propertyTfmVersion == minTfmVersion)
196+
{
197+
// The 'TargetFramework' property already matches the minimum version.
198+
continue;
199+
}
200+
194201
property.Value = minTfmValue;
195202
}
196203
else

0 commit comments

Comments
 (0)