Maybe I'm missing something but I have a system service and I do a File.WriteAllBytes(bla, bla, ...)
Then I want to later, in the service execution, delete that file. The WriteAllBytes creates, opens and closes the file. So, the file should be closed.
Yet when, ater in the service execution, I l try to do a File.Delete(bla) of that temporary file I get an error that it cannot delete the file because it's in use by a process.
The file is a temp file and the only thing using it is the system service.
Am I missing something or is there no way of deleting that file unless the service is stopped and I use the OnStop to delete any and all temporary files?
Any information would be greatly appreciated.