Here's the deal.
My WinApp is running, right? in let's say process 'A'.It creates a file and keeps the handle (keeps the file open for writing, this is a must).
Then it starts other msbuild process, let's call it 'B'. This process is started with the System.Diagnostic.Process class.
At some point, my WinApp (A) needs to delete the previously created file (remember it was created by A itself), and that's when I get an IOException with the message "The process cannot access the file 'X' because it is being used by another process". And it actually is!... If I terminate process 'B', only then 'A' can successfully delete the file.
So my questions are:
1) Is there a way I can tell the process I create not no handle the files I opened?
2) Is there another way to achieve my scenario?