I try to create the below line above all of the files by using System.Xml.Linq
<?xml version="1.0" encoding="utf-8"?>
and here is the code
var firstLine = new XElement(
"?xml",
new XAttribute("version", "1.0"),
new XAttribute("encoding", "UTF-8"),
"?");
but after the run, I get the below error
result Message: System.Xml.XmlException: Name cannot begin with the '?' character, hexadecimal value 0x3F.
I wonder if anyone knows how I can solve this?