System.IO.IOException: There is a time and/or date difference between the client and server
c#
Solution
An IOException is invariably raised due to a low-level Windows error. Looking through the WinError.h SDK header file produces a good match:
//
// MessageId: ERROR_TIME_SKEW
//
// MessageText:
//
// There is a time and/or date difference between the client and server.
//
#define ERROR_TIME_SKEW 1398L
Take this literally, the two machines have clocks that don't tick at the same UTC time. That's a pretty serious problem that needs to be addressed by the respective system administrators. Like having them setup the machines to synchronize their clocks to the domain controller or by enabling the Windows time service. The serverfault.com SE site is a good place to follow up for more questions about this.
Problem
I'm trying to copy a file, using System.IO.File.Copy() from a network location, to a client. This has been working for a long time, but now, all of a sudden, clients are getting this error: System.IO.IOException: There is a time and/or date difference between the client and server. I've googled around, but haven't been able to find anything related to C# or .Net.