I have some code in my logout routine that deletes some temporary session files when the user logs out or when the session expires. Deleting these folders causes my web app to restart. It does not error out or throws an exception it just restarts! Any ideas?
That's by design. There's a threshold to the number of files that can change outside the bin folder, and if they do, the app restarts.
If you change anything at all inside the bin folder, it also restarts.
You need to save the temporary files somewhere else. You could save them in the %TEMP% folder (you can use Path.GetTempPath()
to get it), or create a folder for them specifically OUTSIDE of your web app virtual directory and save the files there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With