save xml to xmlfile
XElement xml2 = new XElement("TopMenus", from b in dc.TopMenuu() select new XElement("TopMenu", new XElement("Id", b.Id), new XElement("Title", b.Title), new XElement("Parent_fk", b.Parent_FK开发者_Python百科), new XElement("PageURL", b.PageUrl)));
xml2.Save(Server.MapPath(".") + "\\XML\\TopMenu.xml");// this line say error
results in an error:
The process cannot access the file 'C:\inetpub\wwwroot\IranFairNew\XML\TopMenu.xml' because it is being used by another process.
this error While simultaneously looking at the browser IE, and Mozilla can run my program asp.net 3.5
how can I solve this problem?
Use process explorer to check nothing is using your file. Looks like your file is in use
精彩评论