Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to create a XML file in my Window project.
I trying below code

XElement xml = new XElement("Persons",new XElement("Person",new XElement("Name", "Name1"),new XElement("City", "City"),new XElement("Age","20")));
xml.Save("XMLFile.xml");
MessageBox.Show("XML File created ! ");

but i do't find, where xml file is save.
Posted

Your file is created in bin/debug/ folder of your project.
 
Share this answer
 
Hi,
As Tarun said, the XML is created in bin\debug Folder. You can overwrite to Specific path by giving the exact file path where it has to be saved
C#
xml.Save(@"D:\TempLogFilePath\XMLFile.xml");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900