Hello,

I have an application which opens various files for reading and writing. The problem I'm having is, if the application errors for whatever reason, the file streams stay open, so next time I run the application I get a "Cannot open file as it is being used by another process.".

The only way to get around this is by ending the task aspnet_wp.exe in task manager. I can't do this in a live environment.

Does anyone know of a solution to this. I was thinking of adding some code in the Application_Error event to check which filestreams are open, and ending them.

Cheers!