Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file in use & aspnet_wp.exe process

Status
Not open for further replies.

blueindian1

Programmer
Apr 24, 2001
150
0
0
US
ok, i have this problem. as any of the regulars have probably realized, i've been trying to write a photo album app for about the last decade. at any rate, i've got it mostly worked out now, except for this problem:

suppose I upload a file to the web server. when i do this, i also create a thumbnail and upload it. then i try to delete them. the thumbnail deletes just fine, but the original image won't. i get this message:


The process cannot access the file "c:\temp\5\couldbeworse.jpg" because it is being used by another process.

WTF? now, the only way i can get this to go away is to kill the process in task manager called aspnet_wp.exe. if i do that, then i can properly delete the file. what is that process? what does it do?

any idea why it's locking my file?


thanks.
 
For the past decade?! What did you start writing this with, QBasic?!

Bu-Dum-Bum

thank you, thank you...I'll be here until Thursday!

ok, all kidding aside, how do you handle the images in your code? Is it possible that some method is creating an image object with the path to your image, not freeing up the reference (Image = Nothing), and when something else tries to snag it its still seen as "being in use"?

D'Arcy
 
aspnet_wp.exe is basically the service space that ASP.Net runs in. From what I remember its like the DLLHost for IIS and regular asp.
 
Sounds like a garbage-collection issue.

When you write the original image to disk, make sure you call .Dispose on your File object. File handles are unmanaged resources and need to be explicitly freed if you expect to manipulate the file sometime before the next 2 collection cycles are run.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top