Use GetRandomFileName instead of GetTempFileName. Fixes #1060

This commit is contained in:
Steve Sanderson
2017-07-03 10:15:53 +01:00
parent 429a432dd3
commit 513d288a5d
2 changed files with 2 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.NodeServices
/// <param name="applicationStoppingToken">A token that indicates when the host application is stopping.</param>
public StringAsTempFile(string content, CancellationToken applicationStoppingToken)
{
FileName = Path.GetTempFileName();
FileName = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(FileName, content);
// Because .NET finalizers don't reliably run when the process is terminating, also