Merge pull request #32 from tebeco/no_xml_declaration_in_csprojet

use XmlWritter to avoid serialising Xml Declaration in csproj
This commit is contained in:
Robert Muehsig
2017-11-04 21:42:07 +01:00
committed by GitHub

View File

@@ -5,6 +5,7 @@ using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
namespace ElectronNET.CLI.Commands
@@ -147,10 +148,19 @@ namespace ElectronNET.CLI.Commands
stream.SetLength(0);
stream.Position = 0;
xmlDocument.Save(stream);
var xws = new XmlWriterSettings
{
OmitXmlDeclaration = true,
Indent = true
};
using (XmlWriter xw = XmlWriter.Create(stream, xws))
{
xmlDocument.Save(xw);
}
Console.WriteLine($"{ConfigName} added in csproj!");
}
Console.WriteLine($"{ConfigName} added in csproj!");
return true;
}
}