using System.Collections.Generic;
using System.Xml.Serialization;
public static void Test()
<?xml version="1.0" encoding="utf-8"?>
<Properties Description="Line 1
var xmlPath = "Question77604035.xml";
File.WriteAllText(xmlPath, xmlString);
using var xmlReader = new XmlTextReader(xmlPath)
var rootElement = XElement.Load(xmlReader);
var propertiesElement = rootElement.Element("Properties")!;
var descriptionAttribute =
propertiesElement.Attribute("Description")!;
string description = descriptionAttribute.Value;
Console.WriteLine(description);
public static void Main()
Console.WriteLine("Environment version: {0} ({1}, {2}, NewLine: {3}).",
System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , Environment.Version, Environment.OSVersion,
System.Text.Json.JsonSerializer.Serialize(Environment.NewLine));
Console.WriteLine("Failed with unhandled exception: ");