when save xml error occur as it is being used by another process.
XmlDocument XDOC = new XmlDocument();
XDOC.Load(System.Web.HttpContext.Current.Server.MapPath("~/XmlFiles/Blog.xml"));
XmlNode RootNode = XDOC.SelectSingleNode("//Blogs");
XmlNode childnode = XDOC.SelectSingleNode("/Blogs/IDs");
//check whether childnode exist or not.
if (childnode != null)
childnode.ParentNode.RemoveChild(childnode);
XmlElement XEle = XDOC.CreateElement("IDs");
XEle.SetAttribute("id", Convert.ToString(ID));
RootNode.AppendChild(XEle);
XDOC.Save(System.Web.HttpContext.Current.Server.MapPath("~/XmlFiles/Blog.xml"));(here getting error)

Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 2, 2016, 11:12 PM EDT
Vishal JadavRank #1,692 · 901 reputationPosted Aug 2, 2016, 11:12 PM EDT
Sourabh ChoubeyRank #8,108 · 228 reputationPosted Aug 2, 2016, 11:15 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Aug 2, 2016, 11:19 PM EDT
Sourabh ChoubeyRank #8,108 · 228 reputationPosted Aug 2, 2016, 11:28 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 2, 2016, 11:35 PM EDT
Sourabh ChoubeyRank #8,108 · 228 reputationPosted Aug 2, 2016, 11:41 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 2, 2016, 11:56 PM EDT
Sourabh ChoubeyRank #8,108 · 228 reputationPosted Aug 3, 2016, 12:26 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 3, 2016, 12:43 AM EDT