tags:

views:

80

answers:

2

Hi, I'm using this XML classes for the first time and can't find this piece of info.

I'm doing:

xmlDoc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));
xmlDoc.Add(new XElement("Images"));
xmlDoc .Save("C:\\Backup\\images.xml");

But doesn't work. It only works if I use just the filename, like "images.xml", but of course, the file gets saved on the execution path.

+5  A: 

By default, you most likely won't be able to save to "C:\Backup" unless you run your program under elevated permissions. You can only save the "user" folders, by default.

Reed Copsey
+1  A: 

Worked for me, must be a permissions issue. Try another directory or make sure c:\Backup exists

Mike