Answer me this, .NET gurus:  <primalscream>Why</primal_scream> does the System.IO.Directory class not include a .Copy() method.  I can Move(), CreateDirectory(), and even Delete(), but I can't copy a directory and all of its contents recursively?  And don't even try to tell me that Directory.Copy() doesn't exist because the .NET team figured that even wannabe programmers like me can create our own .copy() as easily as we can type D-i-r-e-c-t-o-r-y-.-C-o-p-y-(-). 

My attempts to workaround this limitation went like this:

  1. In Visual Studio .NET, I typed System.IO.Directory and press the F1 key. Result: learned a lot about the Directory class that didn't help me accomplish the task before me.
  2. Searched for Index for keyword “directory.copy“ in Visual Studio .NET.  Result: failure
  3. Searched VS.NET help for “Directory.Copy“. Result: failure.
  4. Created my own dir.Copy() ... Result: short attention span...disbelief...decided to consult my friend Google.
  5. Searched Google for “Directory.Copy() +.NET“.  Result: multiple successful hits. Copied sample code snippets* from Web to my project and was successfully copying directories recursively several minutes later.

Takeaways

  • Directory.Copy() should exist, and I am by no means the only .NET developer in the world who thinks this[1].
  • “Directory.Copy” and any other similarly inexplicable class exclusions should in future be added to the MSDN Combined Collection's index, as should a topic that explains why it is not available in the .NET Framework.

[1]http://www.codeproject.com/csharp/copydirectoriesrecursive.asp
http://www.aspemporium.com/aspEmporium/cshrp/howtos/howto.asp?hid=20

And I don't know what this says exactly, but my issue is an international one [http://dobon.net/vb/dotnet/file/copyfolder.html]:

????????Directory.Move??????????????????"Directory.Copy"???????????????.NET Framework????????????????File.Copy????????????????????????

???????????????????(CopyDirectory????)??????????????????????????????

Aha!  This just in [from Kit George]: The .NET team is thinking about adding a Copy method to the System.IO.Directory class for Whidbey. http://weblogs.asp.net/bclteam/archive/2004/01/19/60377.aspx