有一個函數,我已經寫了基本上一天4次爲我加密,並將加密寫入一個xml文件。現在我們有4個區域,分別是Dev,QA,ITE和PROD。我在DEV,QA,ITE沒有得到任何錯誤,但是在PROD中,奇怪的事情正在發生。 上的代碼的失敗的第一個例外是這個爲什麼會發生這種不正常的XML行爲
Invalid XML document, The document does not have a root element.. at System.Xml.XmlDocument.Save(String filename)
,並得到此異常也:
The process cannot access the file 'configfile.xml' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, StringmaybeFullPath)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.XmlDocument.Save(String filename)
我有一種感覺,這是由於併發請求發生。使用的編程語言是C#和ASP.NET 2.0。
有人能夠啓發我嗎?
你可以發佈你如何使用該文件的代碼示例? – 2011-03-17 15:16:50
對不起,隊友不能發佈代碼。嚴格規則 – gizgok 2011-03-17 15:19:13
您是否可以在不包含公司代碼的單獨項目中重新創建問題,並且只要您的問題可見,就可以使用虛擬名稱? – 2011-03-17 16:22:57