According to MSDN the .NET XmlDocument.Load(String) method requires write access to the underlying file. The exceptions list says
UnauthorizedAccessException : filename specified a file that is read-only....
My question boils down to
Is it even true that read-write access is needed
XmlDocument
creates XmlReader
, which, AFAIK, doesn't throws such exceptions.Does it mean that the file is kept open during the lifetime of the object
Does it mean that modifications to the the XmlDocument and its sub-nodes can result in live modifications to the file on disk
with async
attribute set to False
as in XDoc.async = False
, the read-only xml does not get loaded into DOM object
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.