I\'ve seen many issues like this that have been solved and the problem was mostly due to streams not being disposed of properly.
My issue is slightly different, here
You state that your problem has nothing to do with disposing streams but check this MSDN article:
http://msdn.microsoft.com/en-us/library/d62kzs03.aspx
What does File.Create
return? A FileStream!!!!
And, at the end of the day, why are you using File.Create
if File.WriteAllBytes
creates a file if this doesn't exist? ;)
Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
Check it on MSDN too: http://msdn.microsoft.com/en-us/library/system.io.file.writeallbytes.aspx