Merge pull request #41752 from neikeq/fix-invalidopexception-csproj-migration

[3.2] Fix InvalidOperationException when migrating from 3.2.1 or older csproj
This commit is contained in:
Rémi Verschelde 2020-09-04 08:19:18 +02:00 committed by GitHub
commit 93eb9b554e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -287,10 +287,19 @@ namespace GodotTools.ProjectEditor
"ConsolePause"
};
foreach (var config in new[] {"ExportDebug", "ExportRelease", "Debug"})
var configNames = new[]
{
"ExportDebug", "ExportRelease", "Debug",
"Tools", "Release" // Include old config names as well in case it's upgrading from 3.2.1 or older
};
foreach (var config in configNames)
{
var group = root.PropertyGroups
.First(g => g.Condition.Trim() == $"'$(Configuration)|$(Platform)' == '{config}|AnyCPU'");
.FirstOrDefault(g => g.Condition.Trim() == $"'$(Configuration)|$(Platform)' == '{config}|AnyCPU'");
if (group == null)
continue;
RemoveElements(group.Properties.Where(p => yabaiPropertiesForConfigs.Contains(p.Name)));