MSBuild.ExtensionPack.FileSystem.Folder with TaskAction="RemoveContent" throws IOException: The directory is not empty

Mar 12, 2010 at 1:12 PM

Hi guys,

I would like to delete all the files and subfolders inside a folder. For this purpose, I am using <MSBuild.ExtensionPack.FileSystem.Folder> task in my script  with property TaskAction set to "RemoveContent". However there is an inconsistent behaviour. Sometimes when I run the script, it throws IOException with the messsage The directory is not empty. But when i rerun the script it works fine. Any idea why would it be throwing this exception? As I said this does happens occasionally.

 

Regards,
Nabeel Farid

Coordinator
Mar 12, 2010 at 2:10 PM

 

You probably have Anti-virus or Indexing software scanning the path. Try excluding the path from your AV or indexing software. Try running http://technet.microsoft.com/en-gb/sysinternals/bb896645.aspx to see what is accessing the files.
Mike

You probably have Anti-virus or Indexing software scanning the path. Try excluding the path from your AV or indexing software. Try running http://technet.microsoft.com/en-gb/sysinternals/bb896645.aspx to see what is accessing the files.

 

Mike