gpt4 book ai didi

c# - System.IO.Exception 错误 : "The requested operation cannot be performed on a file with a user-mapped section open."

转载 作者:IT王子 更新时间:2023-10-29 04:03:27 32 4
gpt4 key购买 nike

我在写入 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)函数时。

对发生的事情有什么想法吗?

最佳答案

看起来另一个进程使用文件映射(共享内存)API 打开了文件。

Process Explorer 中的查找功能应该可以告诉您。

关于c# - System.IO.Exception 错误 : "The requested operation cannot be performed on a file with a user-mapped section open.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1302698/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com