views:

22

answers:

1

I have a VB .NET Application which I have written for my company which occasionally throws a message “System.IO.IOException: An unexpected network error occurred.”, that I have been unable to figure out the issue.

The application is a Backup program which to simplify for this post does the following:

1) Checks for H drive or external drive with label of “BackupDrive”, if either of these are found it automatically starts a backup of user data  
2) Starts an Async thread that deletes older backups based on how many days the user has specified he/she wants to keep  
3) Starts the main thread that backups up user data and updates current file/folder and results into a console window.  

If the application encounters an error it will email me the results, below are the results from a members of our sales staff this morning:

Time:
10/28/2010 8:25:31 AM

Version:
1.4.0.2

Message:
An unexpected network error occurred.

Full Exception:
System.IO.IOException: An unexpected network error occurred. at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive) at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive) at Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectoryInternal(String directory, DeleteDirectoryOption onDirectoryNotEmpty, UIOptionInternal showUI, RecycleOption recycle, UICancelOption onUserCancel) at Microsoft.VisualBasic.MyServices.FileSystemProxy.DeleteDirectory(String directory, DeleteDirectoryOption onDirectoryNotEmpty) at BackupUserData.TransferDataModule.fn_DeleteFolder(String Source)

Additional Information:
Function fn_DeleteFolder - Source: h:\Backups\Backup from October 26 2010

This error message happens about once a week from one of our sales staff, and I haven't been able to isolate why. It always seems like everything deletes and Backups normally. If they unplugged their network cable I would expect the delete or backup to fail, so I don't think thats the issue.

Any idea's as to whats going on?

A: 

It doesn't have anything to do with your code. The network driver is having problems, look in the Windows Event log for the reason why. Ultimately it needs to be the LAN admin that has to tackle the problem. He can post to serverfault.com for help.

Hans Passant
I believe you were the one who helped me last time, so thanks again. But I'm curious how do you know so quickly what the issue is? I haven't been able to find any MSDN articles that mention this error. I'm very happy if what your saying is true and I can just handle that exception and do nothing with it, one less email I receive :)
JoshF
I know the error, seen it before on a cranky network at a job. It is a standard Windows error, code 59, ERROR_UNEXP_NET_ERR. Google for that.
Hans Passant
Well thanks again. One less thing to worry about ;)
JoshF