System.IO.Exception error: “The requested operation cannot be performed on a file with a user-mapped section open.”

后端 未结 5 842
梦如初夏
梦如初夏 2020-12-03 04:42

I received a very weird IOException when writing to an XML file:

System.IO.IOException: The requested operation cannot be performed on a file with a user-map         


        
5条回答
  •  再見小時候
    2020-12-03 04:55

    In my case, the records in xml document were being iterated and in each iteration the records were being edited and saved. I changed this logic to save the file once after all the records are edited and poofff.. the error is gone.

提交回复
热议问题