Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 513d288

Browse files
Use GetRandomFileName instead of GetTempFileName. Fixes #1060
1 parent 429a432 commit 513d288

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ install:
77
- ps: $urlCurrent = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview2-006497/dotnet-sdk-2.0.0-preview2-006497-win-x64.zip"
88
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
99
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
10-
- ps: $tempFileCurrent = [System.IO.Path]::GetTempFileName()
10+
- ps: $tempFileCurrent = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName())
1111
- ps: (New-Object System.Net.WebClient).DownloadFile($urlCurrent, $tempFileCurrent)
1212
- ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFileCurrent, $env:DOTNET_INSTALL_DIR)
1313
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"

src/Microsoft.AspNetCore.NodeServices/Util/StringAsTempFile.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public sealed class StringAsTempFile : IDisposable
2121
/// <param name="applicationStoppingToken">A token that indicates when the host application is stopping.</param>
2222
public StringAsTempFile(string content, CancellationToken applicationStoppingToken)
2323
{
24-
FileName = Path.GetTempFileName();
24+
FileName = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
2525
File.WriteAllText(FileName, content);
2626

2727
// Because .NET finalizers don't reliably run when the process is terminating, also

0 commit comments

Comments
 (0)