While overwriting an xml file through following steps:
- Read all contents of an xml file in an string array: string[] ls_aLineText = System.IO.File.ReadAllLines( ls_PathAndFile );
- Overwritten contents of the ls_aLineText array
- Overwriting the xml file using: System.IO.File.WriteAllLines( ls_PathAndFile, ls_aLineText );
Steps 1 and 2 execute correctly, but step 3 displays the error "Unable to load" xml file. Please suggest ways to overcome this issue.
Thanks in Advance
Vivek