If you look at the documentation (
MSDN[
^]) you will see:
The following conditions may cause an exception:
The path is not valid for one of the following reasons: it is a zero-length string; it contains only white space; it contains invalid characters; or it is a device path (starts with \\.\) (ArgumentException).
The path is not valid because it is Nothing (ArgumentNullException).
directory does not exist (DirectoryNotFoundException).
directory points to an existing file (IOException).
The path exceeds the system-defined maximum length (PathTooLongException).
A file or directory name in the path contains a colon (:) or is in an invalid format (NotSupportedException).
The user lacks necessary permissions to view the path (SecurityException).
The user lacks necessary permissions (UnauthorizedAccessException).
Since you are getting an IOException, the problem becomes pretty obvious.
Solution: Don't give it a file name when it expects just the path...