I have an asp.net app that creates a pdf file in a network share, attaches it to an email and sends it. This works fine but if I try to create that same file again I get the error below. How can I work around this? I tried File.Delete(filepath) before trying to create it again but that also failed. What are my options? Thanks.
The process cannot access the file 'E:\shared\apps\Lifetime\OfficeDocs\POFiles\46653-15.pdf' because it is being used by another process.