0

I have a Windows Service AND a Website which perform the same action. To copy a file to a network share on a server on another continent.

The Windows Service does an automated action but when there is an error the user can manually initiate the same action from the website.

Both the windows service and website intermittantly return false on a directory.exist using a unc path.

If I recycle the app pool it works. If I restart the web service it works.

I have a domain user account as identity for both the windows service and app pool.

Maybe this is a network permission issue or server timeout?

For now we added some retry logic but I would really like to understand what is happening.

Any ideas?

D. Kermott
  • 1,613
  • 17
  • 24
  • 1
    I suggest you open a case via: https://support.microsoft.com, microsoft engineers will help find the root cause. – samwu Sep 03 '21 at 07:24

1 Answers1

0

You have here an answer.

They propose to use new DirectoryInfo(path).Exists instead of directory.exist for UNC folders.

Ygalbel
  • 5,214
  • 1
  • 24
  • 32
  • 1
    Hi @Ygalbel, thanks for your response. We did switch to DirectoryInfo.Exists but were still getting a return of false. We added some retry logic and that has helped but I was hoping there would be a more concrete reason for this. or maybe some way to troubleshoot and pinpoint what is happening. Maybe Wireshark? – D. Kermott Sep 02 '21 at 14:54