Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 48502c9

Browse files
committed
Fix #414: Loading enum-typed formatter settings from .csproj files fails.
1 parent 848e257 commit 48502c9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,11 +1467,15 @@ public override XElement LoadProjectExtensions(string name)
14671467
existing = projectFile.CreateProjectExtensionsElement();
14681468
return new XElement(name);
14691469
}
1470-
string content = existing[name];
1470+
// Instead of using existing[name] we use a workaround here, because existing[name]
1471+
// removes all xmlns="..." definitions, which are needed for XAML deserialization.
1472+
string content = existing.Content;
14711473
if (string.IsNullOrEmpty(content))
14721474
return new XElement(name);
14731475
try {
1474-
return XElement.Parse(content);
1476+
var extensionsElement = XElement.Parse(content);
1477+
var propertiesElement = extensionsElement.Elements().FirstOrDefault(); // Should be the "Properties" node
1478+
return propertiesElement ?? new XElement(name);
14751479
} catch (XmlException ex) {
14761480
LoggingService.Warn(ex);
14771481
return new XElement(name);

0 commit comments

Comments
 (0)