【发布时间】:2010-11-21 02:56:08
【问题描述】:
我在写入 XML 文件时收到了一个非常奇怪的 IOException:
System.IO.IOException: The requested operation cannot be performed on a file with a user-mapped section open.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)
at System.Xml.XmlDocument.Save(String filename)
当我调用 XmlDocument 的 Save(string) 函数时发生错误。
对发生的事情有什么想法吗?
【问题讨论】:
标签: c# xml ioexception