mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-14 05:34:48 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user