ashkufaraz
ashkufaraz

Reputation: 5297

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), 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?

Upvotes: 1

Views: 123

Answers (1)

Tom Squires
Tom Squires

Reputation: 9286

Use process explorer to check nothing is using your file. Looks like your file is in use

Upvotes: 2

Related Questions