none
GetDirectories error : There is a time and/or date difference between the client and server RRS feed

  • Question

  • Running .NET 4.0 and we saw this error in our app that polls UNC folders and processes files.   What causes this error?

    TypeName: System.IO.IOException

    TypeAssembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    Message: There is a time and/or date difference between the client and server.

    Source: mscorlib

    TargetSite: Void WinIOError(Int32, System.String)

    StackTrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

       at System.IO.FileSystemEnumerableIterator`1.CommonInit()

       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler)

       at System.IO.DirectoryInfo.InternalGetDirectories(String searchPattern, SearchOption searchOption)

       at System.IO.DirectoryInfo.GetDirectories()


    • Edited by scott_m Wednesday, January 30, 2013 5:43 PM
    Wednesday, January 30, 2013 5:32 PM

Answers

  • Have you compared the clocks on the client machine and the server where the directories are located? The message indicates that the time difference between the two clocks has exceeded the maximum tolerance. If you're not sure how to go about resynchronizing the clocks have a look at the documentation here.
    • Marked as answer by scott_m Thursday, January 31, 2013 5:37 PM
    Thursday, January 31, 2013 12:05 AM

All replies

  • Have you compared the clocks on the client machine and the server where the directories are located? The message indicates that the time difference between the two clocks has exceeded the maximum tolerance. If you're not sure how to go about resynchronizing the clocks have a look at the documentation here.
    • Marked as answer by scott_m Thursday, January 31, 2013 5:37 PM
    Thursday, January 31, 2013 12:05 AM
  • Hi Scott,

    Nice to see you.

    What the code did you try?

    And what kind of directories do you try to get?

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, January 31, 2013 11:22 AM
    Moderator
  • Hi Scott,

    Nice to see you.

    What the code did you try?

    And what kind of directories do you try to get?

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Our Sys Admin says that all servers are sync'd with NTP so not really sure what is wrong.
    Thursday, January 31, 2013 5:38 PM
  • Have you checked what the clocks are actually reporting on both machines?

    Tuesday, February 5, 2013 10:38 PM