Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cannot delete file from webserver...... process cannot access style error

Reply
Thread Tools

Cannot delete file from webserver...... process cannot access style error

 
 
news.microsoft.com
Guest
Posts: n/a
 
      01-08-2005
I need some help here guys.... i have been simply trying to delete a file
from the webserver using asp.net

using the following code.

System.IO.File.Delete(FullPath);
however the error message i get is the following

The process cannot access the file
"e:\inetpub\wwwroot\client_dev\brands\Product_imag es\1450.jpg" because it is
being used by another process.

What other process could be doing this? it is happening both on our dev box
AND up at our host...

in code i do not have any references to the file at all.... so there couldnt
be any locks that i am causing intentionally....

what else could lock a file.... and if so how can i remove the lock so i can
DELETE the file..


 
Reply With Quote
 
 
 
 
Axel Dahmen
Guest
Posts: n/a
 
      01-08-2005
Is it possible that some other of your web pages is just showing this
picture, so that there's a lock caused by that?

HTH,
Axel Dahmen


-----------------
"news.microsoft.com" <(E-Mail Removed)> schrieb im Newsbeitrag
news:#(E-Mail Removed)...
> I need some help here guys.... i have been simply trying to delete a file
> from the webserver using asp.net
>
> using the following code.
>
> System.IO.File.Delete(FullPath);
> however the error message i get is the following
>
> The process cannot access the file
> "e:\inetpub\wwwroot\client_dev\brands\Product_imag es\1450.jpg" because it

is
> being used by another process.
>
> What other process could be doing this? it is happening both on our dev

box
> AND up at our host...
>
> in code i do not have any references to the file at all.... so there

couldnt
> be any locks that i am causing intentionally....
>
> what else could lock a file.... and if so how can i remove the lock so i

can
> DELETE the file..
>
>



 
Reply With Quote
 
 
 
 
vMike
Guest
Posts: n/a
 
      01-08-2005

"news.microsoft.com" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I need some help here guys.... i have been simply trying to delete a file
> from the webserver using asp.net
>
> using the following code.
>
> System.IO.File.Delete(FullPath);
> however the error message i get is the following
>
> The process cannot access the file
> "e:\inetpub\wwwroot\client_dev\brands\Product_imag es\1450.jpg" because it

is
> being used by another process.
>
> What other process could be doing this? it is happening both on our dev

box
> AND up at our host...
>
> in code i do not have any references to the file at all.... so there

couldnt
> be any locks that i am causing intentionally....
>
> what else could lock a file.... and if so how can i remove the lock so i

can
> DELETE the file..
>

There is a good chance you have some unmanaged code that is opening the file
but not closing/disposing of it and therefore it is still in use. You need
to call the close or dispose method. Asp does not manage file operations in
many cases.

Mike


 
Reply With Quote
 
Derek Harmon
Guest
Posts: n/a
 
      01-08-2005
"news.microsoft.com" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> what else could lock a file.... and if so how can i remove the lock


If the dev box is XP, try opening a command prompt and running

openfiles /?

You need to activate it and re-boot, but this utility can be helpful
diagnosing what process is keeping the file(s) open. Other third-
party GUI tools exist that provide similar functionality.


Derek Harmon


 
Reply With Quote
 
=?Utf-8?B?Q2hpbm1heQ==?=
Guest
Posts: n/a
 
      01-10-2005
I would like to know, whether you're uploading that File using
HTTPPost.SaveAs Method?

"news.microsoft.com" wrote:

> I need some help here guys.... i have been simply trying to delete a file
> from the webserver using asp.net
>
> using the following code.
>
> System.IO.File.Delete(FullPath);
> however the error message i get is the following
>
> The process cannot access the file
> "e:\inetpub\wwwroot\client_dev\brands\Product_imag es\1450.jpg" because it is
> being used by another process.
>
> What other process could be doing this? it is happening both on our dev box
> AND up at our host...
>
> in code i do not have any references to the file at all.... so there couldnt
> be any locks that i am causing intentionally....
>
> what else could lock a file.... and if so how can i remove the lock so i can
> DELETE the file..
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot delete a file the process cannot access the file because it is being used by another process ASp.net 2 ary ASP .Net 2 11-29-2006 04:30 AM
Cannot delete a file the process cannot access the file because it is being used by another process ASp.net 2 ary ASP .Net 0 11-28-2006 09:13 AM
Error: The process cannot access the file ".mdb" because it is being used by another process. lucy ASP .Net 2 10-12-2005 07:03 PM
Cannot Copy Assembly <MyAssembly> The Process Cannot Access The File Because It Is Being Used By Another Process Ram ASP .Net 2 06-30-2005 11:30 AM
delete file failed, The process cannot access the file because it is being used by another process guoqi zheng ASP .Net 3 04-13-2005 06:17 PM



Advertisments