I have written an application that modifies an XML file containing the data required for my transformation. Everything works great in my development environment, but in production (godaddy.com), I get the follow error...
Error: System.IO.IOException: The process cannot access the file 'd:\hosting\gkuhn2\home\Portals\0\UpdatablePages\updatable_pages.xml' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.Delete(String path) at IMG_updatepages.PublishNewXml(XmlDocument& xdocNew, String root)
Here is the chain of events that leads to the error:
- Create, modifiy and save an XML file using XMLDocument
- View a page that consumes the XML using the XML Module
- Execute the create, modify, save process again. This time the error is thrown.
- If I restart the application via the Host properties menu and repeat from step 1, the exact same thing happens.
So far I know the following.
A. It only happens in production
B. The XmlReader returned by the XmlSource property of the XmlController class does not seem to dispose of the XmlReader properly. I am wondering if this might be the cause, eventhough it only happends in production.
Thanks in advance.
Does anyone have any insite into this problem?