Directory.CreateDirectory does not throw error if the directory already exists.

By [)ia6l0 iii

"http://msdn.microsoft.com/en-us/library/54a0at6s(v=VS.80).aspx - The MSDN link to Create Directory method misleads.

The System.IO exception as per the article does not happen. I know this does not optimize your code, but definetely removes the redundant code

So do not do  the Directory.Exists check before Creating the directory
//if (!Directory.Exists(workDirectory))
Directory.CreateDirectory(workDirectory);

Directory.CreateDirectory does not throw error if the directory already exists.  (1297 Views)