The process cannot access the file because it is being used by another process

前端 未结 10 963
忘了有多久
忘了有多久 2020-11-30 09:38

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

10条回答
  •  有刺的猬
    2020-11-30 10:19

    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.

提交回复
热议问题