Semaphore timeout expired

I have a simple C # program that copies files from one network share to another. The program simply ran the error "Semaphore timeout expired." I have never seen this before, and I'm a little confused as to what it is.

The code is pretty simple: (srcPath and destPath are read from the configuration settings)

DirectoryInfo di = new DirectoryInfo(srcPath); try { FileInfo[] files = di.GetFiles(); foreach (FileInfo fi in files) { if(!(fi.Name.Contains("_desc"))) { File.Copy(fi.FullName, destPath + fi.Name, true); } } } catch (Exception xx) { SendMail(xx.Message, xx.StackTrace); } finally { } 
+4
source share
3 answers

This is usually a general error message and is probably related to three possibilities:

  • Communication Check network cables, USB connections / cables, reset USB hub, network switches ..

  • Verify that the file names are too long or too long.

  • Associated with a hard drive. Make sure that you have enough free space and that the disk has no errors and is not fragmented.

EDIT: added hard drive.

+2
source

Take a look at this MS manual for a similar error , it seems to be known. Problem when copying files over the network

troubleshooting steps:

  • Update the wireless adapter driver on both computers.

  • Temporarily disable all firewalls and antivirus applications, then check the problem again.

  • To exclude factors from other services and applications, perform a clean boot to verify the problem and complete step 4.

(KB929135) How to fix the problem by performing a clean boot into Windows Vista http://support.microsoft.com/default.aspx?scid=kb;EN-US;929135

  • With a clean boot, try applying the fixes contained in the following knowledge base articles:

(KB932045) Error message when using a network connection to copy a large file from one computer running Windows Vista to another Windows Vista computer: "Connection lost" http://support.microsoft.com/default.aspx?scid=kb ; EN-US; 932045

(KB932063) Several problems occur on a computer running Windows Vista when you are working in a wireless network environment http://support.microsoft.com/default.aspx?scid=kb;EN-US;932063

If the problem still persists after the steps above, this problem is very possible, due to network devices or configurations, please let me know:

  • Does this problem occur on a wired network?

  • When amplifying network signals, can the problem be changed?

  • What file size will result in this error.

  • Does this error complete the copy process?

  • Models of the wireless network adapter and wireless router.

+1
source

This happens to me when a hard drive crashes in my USB-connected Drobo drive array

0
source

Source: https://habr.com/ru/post/1433349/


All Articles