I need to generate a unique temporary file with a .csv extension.
What I do right now is
string filename = System.IO.Path.GetTempFileName().Replace(
You can also do the following
string filename = Path.ChangeExtension(Path.GetTempFileName(), ".csv");
and this also works as expected
string filename = Path.ChangeExtension(Path.GetTempPath() + Guid.NewGuid().ToString(), ".csv");