473,394 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

"file in use" from XmlDocument.Load

I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Load: "process cannot access the
file <filepath here> because it is being used by another process." Why
should a document read operation have any sort of locking issues - even if
two users are attempting to read the file at the same time, this should not
be a problem. I don't think this is happening at the same time as a call to
XmlDocument.Save on the file either, so I don't believe that is the issue
(though I'm not sure why that would be a problem in any case).

The same error has also been raised when trying to load an XML document by
the application after a new version of the XML file was uploaded via FTP to
the web server. (The XML document is saved in the application Cache and is
automatically reloaded when the file changes using the cache dependency
functionality.)

Any help on this issue would be appreciated - I have searched many different
forums and web sites but have not yet found an answer.

EK
Nov 19 '05 #1
3 2449

you might want to try FileMon from SysInternals. The tool will let you
see the who / what / when of file system activity. Perhaps another
program, like an AV tool or indexing tool is opening for exclusive
access.

http://www.sysinternals.com/ntw2k/source/filemon.shtml

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 10 May 2005 07:52:12 -0700, "ek03"
<ek**@discussions.microsoft.com> wrote:
I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Load: "process cannot access the
file <filepath here> because it is being used by another process." Why
should a document read operation have any sort of locking issues - even if
two users are attempting to read the file at the same time, this should not
be a problem. I don't think this is happening at the same time as a call to
XmlDocument.Save on the file either, so I don't believe that is the issue
(though I'm not sure why that would be a problem in any case).

The same error has also been raised when trying to load an XML document by
the application after a new version of the XML file was uploaded via FTP to
the web server. (The XML document is saved in the application Cache and is
automatically reloaded when the file changes using the cache dependency
functionality.)

Any help on this issue would be appreciated - I have searched many different
forums and web sites but have not yet found an answer.

EK


Nov 19 '05 #2

"ek03" <ek**@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Load: "process cannot access the file <filepath here> because it is being used by another process." Why
should a document read operation have any sort of locking issues - even if
two users are attempting to read the file at the same time, this should not be a problem. I don't think this is happening at the same time as a call to XmlDocument.Save on the file either, so I don't believe that is the issue
(though I'm not sure why that would be a problem in any case).


I had a similar problem. It turned out that the file was being lock at the
time of the FTP load. I solve the problem by adding a small routine to put
the put the process to sleep for a few seconds if the file is in the process
of upload, then retry the operation. Hope this helps.
Mike
Nov 19 '05 #3
Thank you for the suggestion - I will try FileMon out.

"Scott Allen" wrote:

you might want to try FileMon from SysInternals. The tool will let you
see the who / what / when of file system activity. Perhaps another
program, like an AV tool or indexing tool is opening for exclusive
access.

http://www.sysinternals.com/ntw2k/source/filemon.shtml

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 10 May 2005 07:52:12 -0700, "ek03"
<ek**@discussions.microsoft.com> wrote:
I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Load: "process cannot access the
file <filepath here> because it is being used by another process." Why
should a document read operation have any sort of locking issues - even if
two users are attempting to read the file at the same time, this should not
be a problem. I don't think this is happening at the same time as a call to
XmlDocument.Save on the file either, so I don't believe that is the issue
(though I'm not sure why that would be a problem in any case).

The same error has also been raised when trying to load an XML document by
the application after a new version of the XML file was uploaded via FTP to
the web server. (The XML document is saved in the application Cache and is
automatically reloaded when the file changes using the cache dependency
functionality.)

Any help on this issue would be appreciated - I have searched many different
forums and web sites but have not yet found an answer.

EK


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bill N. | last post by:
Using VB .Net 2003 Standard Edition. This simple form has a "File in Use" problem while the executable is running. Created this simple program to make sure that I hadn't done something in my...
1
by: John Pastrovick | last post by:
Is there a way to load an image locally (in the client) when a selection of a file is made using input type=file. The purpose is to allow selection of a file and put the image in the browser...
0
by: bleedledeep | last post by:
I have 3 C# applications that run as a group. If I run each of these applications individually, they all start fine. If I have a batch file that starts each of them quickly, on *most* machines...
3
by: Peter Theill | last post by:
Hi, I'm trying to include the content of a request into an Xml document: if (System.Web.HttpContext.Current.Session != null) { XmlDocument d = new XmlDocument(); d.Load(new...
7
by: Drew Berkemeyer | last post by:
I've encounted a pretty strange problem and I'm not quite sure what to make of it. I have a web service that consumes an XML file as well as a few other parameters. This web service works fine...
4
by: mattsthompson | last post by:
Im writing a DLL that extends IHttpHandler to intercept requests for a certain file extension and deliver watermarked images. I'm using LeadTools' .NET framework for the image manipulation and it...
0
by: yma | last post by:
Hi, I have a web.config file that contains <httpHandlers> section that causes "cannot load file..." error. If I delete this section, it is OK. Why did vb.net add this section? It does not add...
2
by: eBob.com | last post by:
I've got the basics of an XML ini file working. I.E. I can stash away and retrieve user preferences. (Code below.) But how do I handle a new preference? Say I have A and B. And then I invent...
9
by: Anubhav Jain | last post by:
Hi, I am having few .net source files(.cs or .vb) and I want to dynamically generate the corresponding .net project file(.csproj or .vbproj) for them without using visual studio.So that I could...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.