J
John
I get this error while reading my config file but it is only occasionally
and not all the time. I'm not sure why its happening. Does anyone know what
could be going wrong? Thanks.
[28/03/2006 14:52:06] The process cannot access the file 'C:\GCC Business
Layer\GCCBL.config' because it is being used by another process. - at
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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)
at GCCBL.CoolFusion.ReadConfig(String myValue)
**************************************************************************
My Code :
System.IO.FileStream fsReadXml = new System.IO.FileStream
(System.AppDomain.CurrentDomain.BaseDirectory + "GCCBL.config",
System.IO.FileMode.Open);
// Create an XmlTextReader to read the file.
System.Xml.XmlTextReader myXmlReader =
new System.Xml.XmlTextReader(fsReadXml);
// Read the XML document into the DataSet.
DataSet myDataSet = new DataSet();
myDataSet.ReadXml(myXmlReader);
// Close the XmlTextReader
myXmlReader.Close();
fsReadXml.Dispose();
and not all the time. I'm not sure why its happening. Does anyone know what
could be going wrong? Thanks.
[28/03/2006 14:52:06] The process cannot access the file 'C:\GCC Business
Layer\GCCBL.config' because it is being used by another process. - at
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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)
at GCCBL.CoolFusion.ReadConfig(String myValue)
**************************************************************************
My Code :
System.IO.FileStream fsReadXml = new System.IO.FileStream
(System.AppDomain.CurrentDomain.BaseDirectory + "GCCBL.config",
System.IO.FileMode.Open);
// Create an XmlTextReader to read the file.
System.Xml.XmlTextReader myXmlReader =
new System.Xml.XmlTextReader(fsReadXml);
// Read the XML document into the DataSet.
DataSet myDataSet = new DataSet();
myDataSet.ReadXml(myXmlReader);
// Close the XmlTextReader
myXmlReader.Close();
fsReadXml.Dispose();