Link to home
Start Free TrialLog in
Avatar of priyanka_kothari
priyanka_kothariFlag for India

asked on

The process cannot access the file D:\abc.xml because it is being used by another process.

Hi
I am loading a input xml into XML Document (InputXML), processing the xml document and then saves the result in a temporary xml file. When I copy temporary xml file to input xml, it gives me error. I am using File.Copy().
Avatar of trebbe
trebbe
Flag of United Kingdom of Great Britain and Northern Ireland image

can you post some code?
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of priyanka_kothari

ASKER

Instead of loading xmlDocument from file, I first read file into XMLTextReader and then I am loading into XML Document
My problem was solved after i added Thread.Sleep and loaded file from XMLTextReader