Attempt to workaround issues with File.Move on NFS file shares (aspnet/Home#2941)

This commit is contained in:
Nate McMaster 2018-04-13 15:06:17 -07:00
parent 49bc8ba1fa
commit faf2f3f065
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
1 changed files with 3 additions and 1 deletions

View File

@ -230,7 +230,9 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
// Once the file has been fully written, perform the rename.
// Renames are atomic operations on the file systems we support.
_logger.WritingDataToFile(finalFilename);
File.Move(tempFilename, finalFilename);
// Use File.Copy because File.Move on NFS shares has issues in .NET Core 2.0
File.Copy(tempFilename, finalFilename);
}
finally
{