Problem
You have called the
CreateDirectory
function, which always expects parameter
path
.
System.IO.Directory.CreateDirectory(String path)
But the value of
path
you have passed is
null
.
[ArgumentNullException: Value cannot be null.
Solution
So, check if it
null
or not before you call that method.
if(!string.IsNullOrEmpty(path))
{
System.IO.Directory.CreateDirectory(String path);
}