I have an odd problem... and I think I have narrowed it down to a point where we create a temporary file using Page.GetTempFileName()
.
I sometimes get a error message stating that Cannot create a file when that file already exists.
Is there a chance that using Path.GetTempFilename()
could generate the same filename and become cached?
I am changing my code to use:
Path.Combine(System.IO.Path.GetTempPath(), string.Concat(Guid.NewGuid().ToString(), ".xls"));
In the hope that this will generate a unique filename, but I am concerned that the same problem may arise.