Skip to content Skip to sidebar Skip to footer

Write Xml To File

I know that there are many same questions here, but it doesn't solve my problem I want to write xml to file. Writing Android app on Xamarin. I already create it I create xml like t

Solution 1:

It seems like you are trying to save the file with an invalid path: /myFile.xml.

Try using a fully qualified path, by doing the following:

var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
var filePath = Path.Combine(documentsPath, "myFile.xml");
File.WriteAllText(filePath, doc.ToString());

Post a Comment for "Write Xml To File"