By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,681 Members | 1,864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,681 IT Pros & Developers. It's quick & easy.

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

P: n/a
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..
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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" <dc******@hotmail.com> schrieb im Newsbeitrag
news:#m**************@TK2MSFTNGP15.phx.gbl...
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..

Nov 19 '05 #2

P: n/a

"news.microsoft.com" <dc******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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
Nov 19 '05 #3

P: n/a
"news.microsoft.com" <dc******@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl...
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
Nov 19 '05 #4

P: n/a
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..

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.