if (Directory.Exists("BarCodePNG"))
{
Directory.Delete("BarCodePNG", true);
}
if (Directory.Exists("BarCodeJPG"))
{
Directory.Delete("BarCodeJPG", true);
}
if (Directory.Exists("BarCodeJoinJPG"))
{
Directory.Delete("BarCodeJoinJPG", true);
}
if (Directory.Exists("output.pdf"))
{
Directory.Delete("output.pdf", true);
}
The error is
System.IO.IOException: 'The process cannot access the file '2072675160.png' because it is being used by another process.'
Where as I want the folder to be force deleted
//I think you need to close the running data before executing the delete code