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.con fig' because it is being used by another process. - at
System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIB UTES secAttrs, String msgPath, Boolean
bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode)
at GCCBL.CoolFusio n.ReadConfig(St ring myValue)
*************** *************** *************** *************** **************
My Code :
System.IO.FileS tream fsReadXml = new System.IO.FileS tream
(System.AppDoma in.CurrentDomai n.BaseDirectory + "GCCBL.conf ig",
System.IO.FileM ode.Open);
// Create an XmlTextReader to read the file.
System.Xml.XmlT extReader myXmlReader =
new System.Xml.XmlT extReader(fsRea dXml);
// Read the XML document into the DataSet.
DataSet myDataSet = new DataSet();
myDataSet.ReadX ml(myXmlReader) ;
// Close the XmlTextReader
myXmlReader.Clo se();
fsReadXml.Dispo se();
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.con fig' because it is being used by another process. - at
System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIB UTES secAttrs, String msgPath, Boolean
bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode)
at GCCBL.CoolFusio n.ReadConfig(St ring myValue)
*************** *************** *************** *************** **************
My Code :
System.IO.FileS tream fsReadXml = new System.IO.FileS tream
(System.AppDoma in.CurrentDomai n.BaseDirectory + "GCCBL.conf ig",
System.IO.FileM ode.Open);
// Create an XmlTextReader to read the file.
System.Xml.XmlT extReader myXmlReader =
new System.Xml.XmlT extReader(fsRea dXml);
// Read the XML document into the DataSet.
DataSet myDataSet = new DataSet();
myDataSet.ReadX ml(myXmlReader) ;
// Close the XmlTextReader
myXmlReader.Clo se();
fsReadXml.Dispo se();
Comment