How to close this XML file after reading?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm using
XDocument document = XDocument.Load (XmlReader.Create (file));

to load in contents of a XML-file for parsing.
However, i noticed that the file seems to be
locked by the process and i can't save changes
made to it in VS until it ends.

How can i close the file?

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.


.



Relevant Pages

  • Re: How to close this XML file after reading?
    ... XDocument document = XDocument.Load ); ... Assuming that the entire file is parsed in the Load() method, ... or maybe just close the source file immediately after parsing. ... using (XmlReader reader = XmlReader.Create(file)) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Any way to get information from fun objects about their parameters?
    ... > For autodocumentation purposes, I'd like to be able to load a module ... easier than parsing the module itself. ... > would also be stored with function objects. ...
    (comp.lang.python)
  • Re: Any way to get information from fun objects about their parameters?
    ... >> For autodocumentation purposes, I'd like to be able to load a module ... > easier than parsing the module itself. ... >> would also be stored with function objects. ...
    (comp.lang.python)
  • Re: MSXML - Check if document loaded
    ... Hmmm, suddenly realised that if you can't load the document synchronously, ... >>> checking and the whole parsing when the readyState is 4. ... >>> End Sub ...
    (microsoft.public.vb.general.discussion)
  • Caching file stream?
    ... ever page load. ... Is there a way to avoid doing the text file read and parsing on every ... periodically refresh when something changes. ...
    (microsoft.public.dotnet.framework.aspnet)