I have the following XML but struggling to get the DisplayName text, it keeps saying its a null value:
<?xml version="1.0" encoding="utf-8"?>
<Package Test="Value">
<Identity Name="Reserved" Publisher="CN=Reserved" Version="0.0.0.0" />
<Properties>
<DisplayName>Application Name</DisplayName>
<PublisherDisplayName>Reserved</PublisherDisplayName>
<Description>Reserved</Description>
<Logo>Reserved.jpeg</Logo>
</Properties>
</Package>
I've used the following
XElement Manifest = XElement.Load(@"c:\temp\file.xml");
var ins = Manifest.Attribute("Test").Value.ToString();
var PackageName = Manifest.Element("Properties").Attribute("DisplayName").Value; // doesn't work
How do I get the DisplayName text?
In Powershell its really easy but I'm struggling to do the same with C#
[xml]$manifest = gc "C:\temp\file.xml"
$manifest.Package.Test
$DisplayName = $manifest.Package.Properties.DisplayName