I have a set of nightly reports.
Sometimes I get the exception:
The process cannot access the file because it is being used by another proce
The problem was the MailMessage in .NET was holding on to the file attachments. I had to do a dispose on the attachment and then it worked.