473,803 Members | 3,886 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"file in use" from XmlDocument.Loa d

I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Loa d: "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.Sav e 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 2477

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**@discussio ns.microsoft.co m> wrote:
I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Loa d: "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.Sa ve 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
automaticall y 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**@discussio ns.microsoft.co m> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Loa d: "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.Sav e 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**@discussio ns.microsoft.co m> wrote:
I have a web application that saves/loads XML documents. On occasion, an
error is logged on the call to XmlDocument.Loa d: "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.Sa ve 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
automaticall y 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
12407
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 code in the "real" project. In the "real" project, One part of the program saves multiple images and another part of the program moves the images to the appropriate directories based on user feedback.
1
9126
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 without loading the reloading the page. I thought about 1. putting a function call in the onchange event of the html input
0
1514
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 all three run fine. BUT! On some older/slower machines (really not all that old or slow and that are configured identically to the newer/faster machines), when I start all 3 with the batch file, one of them will not start and a popup containing:
3
2433
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 XmlTextReader("http://localhost/page.aspx")); } The requested page (page.aspx) is an XHTML page so I'm able to parse it as a
7
2676
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 if I use the web test interface. It also works fine if I call it from an ASP.NET page that has a text box where the XML is pasted and then passed on. However, I get an exception if I use an <input type="file"> control on the ASP page that allows...
4
1975
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 is their Codecs.Load which issues the error. I have the code working when the image is loaded from my local machine but when loading from a network share I receive a File Not Found error from the framework that is attempting to load then file...
0
1725
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 this section now. Thank you. <!-- PREVENT SOURCE CODE DOWNLOAD This section sets the types of files that will not be downloaded. As well as entering a httphandler for a file type, you must also associate that file
2
1931
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 C. The first time the new version with C is run the XML file will not have a value for C. How do I detect that case? Somewhere I got the impression that I could use IsNull, but I was unable to find an example which I could apply to my code. My...
9
5450
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 be able to generate and compile the project on the enviroments where Visual Studio.Net is not installed. Thanks and Regards, Anubhav Jain MTS Persistent Systems Pvt. Ltd. Ph:+91 712 2226900(Off) Extn: 2431 Mob : 094231 07471
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10546
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10292
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.