There is nothing that would cause that error for only one of the files that you described.
Shazz Rock wrote:
Say the path is "D:\Project" there is 3 files 1.xml, 2.xml, 3.xml
Say what the real file names are instead. Also, where do you get the value for file.Path?
Despite everything, the person most likely to be fooling you next is yourself.