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(); 2 7646
Nobody has any idea?
"John" <jh******@msn.com> wrote in message
news:eT**************@TK2MSFTNGP11.phx.gbl... 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();
Change
(System.AppDomain.CurrentDomain.BaseDirectory + "GCCBL.config",
System.IO.FileMode.Open);
to
(System.AppDomain.CurrentDomain.BaseDirectory + "GCCBL.config",
System.IO.FileMode.Open, System.IO.FileAccess.Read);
By default it is opening read/write exclusive use.
Jim Hughes
"John" <jh******@msn.com> wrote in message
news:eT**************@TK2MSFTNGP11.phx.gbl... 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();
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Paul |
last post by:
Hi,
VB.NET is saying the file I am creating is in use by another process and
won't complete its task of moving the file to the specified destination
folder.
Here is my code (the main bit...
|
by: Mountain Bikn' Guy |
last post by:
I am having serious problems with the following IDE bug:
Could not write to output file 'x.dll' -- 'The process cannot access the
file because it is being used by another process. '
and
BUG:...
|
by: trellow |
last post by:
Hello,
I am writing an application that needs to read a file that is already open by another process for writing.
When I do the following:
FileStream fs = new FileStream(fileName,...
|
by: Raed Sawalha |
last post by:
Hello , I have windows service which do listening to specified directory
using FileSystemWatcher , on Created Event and Get all the files in the
directory using Directory.GetFiles function then...
|
by: guoqi zheng |
last post by:
Dear sir,
There is an import tool on my web application, user can upload Ms Access
file, the file is saved at a temp folder on the server. After the import is
finished, for security reason, I...
|
by: Sin |
last post by:
> Xxxxx : error PRJ0008 : Could not delete file 'd:\xxxxxxx.dll'.
> Make sure that the file is not open by another process and is not
write-protected.
>
> LINK : fatal error LNK1168: cannot open...
|
by: ZWeng |
last post by:
I created a windows service using FileSystemWatcher to moniter a folder for
file drops. The service uses FileStream and StreamReader to read and process
the file. After it is done, the file is...
|
by: imranabdulaziz |
last post by:
Dear All,
I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2005 as a back End
I generated local mode report but as there was no printing option available . I assign...
|
by: nightangel |
last post by:
Hi dude,what i was done in my application is uploading a image file to my server using FTP, it work great when pushing a file into the server path using FTP.
The problem i met now is i need to do a...
|
by: =?Utf-8?B?VkIgSm9ubmll?= |
last post by:
I am at my witless end here, please help!
I have an ASP.Net aspx web page, hosted on Windows Server 2003, that
receives a query string with the path to an autocad drawing file selected
from a...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |