Fix InvalidOperationException when migrating from 3.2.1 or older csproj
This commit is contained in:
parent
939ed5dd5b
commit
f8e3a74f9e
|
@ -287,10 +287,19 @@ namespace GodotTools.ProjectEditor
|
||||||
"ConsolePause"
|
"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
|
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)));
|
RemoveElements(group.Properties.Where(p => yabaiPropertiesForConfigs.Contains(p.Name)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue