none
XDocument Save RRS feed

  • Question

  • I an using XDocument for serializing the xml data (XDocument.Save()). However some times I am seeing the file is created like

    XmlFile.xml

    XmlFile (1).xml

    So can any one tell me what could be the reason for creating the files like above.

    Friday, February 1, 2019 6:30 AM

All replies

  • Hi Krishna BS,

    Thank you for posting here.

    For your question, I do not understand what you mean. You use XDocument.Save() to save the xml file named XmlFile.xml or XmlFile (1).xml, is there something wrong?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 1, 2019 7:21 AM
    Moderator
  • My question is, two files are created one with "XmlFile.xml" and second one with XmlFile (1).xml. where I am trying to create only "XmlFile.xml". The other one (file name with (1)) I am not sure how that file was created. 

    XmlFile.xml

    XmlFile (1).xml

    Monday, February 4, 2019 9:54 AM
  • Hi Krishna BS,

    Thank you for feedback.

    Do you create the xml file using XDocument.Save() method? If yes, you could use XDocument.Save(fileName) to save the xml file which named XmlFile (1).xml.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 5, 2019 2:35 AM
    Moderator