有一个函数,我已经写了基本上一天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