Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs =================================================================== diff -u -r380f2075e3cc1eaa4c497360c1df9e909d0a6f87 -r130df59d469fe5daf7db042cebf3939b926008d6 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision 380f2075e3cc1eaa4c497360c1df9e909d0a6f87) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision 130df59d469fe5daf7db042cebf3939b926008d6) @@ -137,6 +137,8 @@ { if (Directory.Exists(tempFolderPath)) { + ForceZipFileToReleaseAllFileHandles(); + Directory.Delete(tempFolderPath, true); } } @@ -228,5 +230,11 @@ var fileNameWithExtension = $"{fileName}.{fileExtension}"; return Path.Combine(currentFolderPath, fileNameWithExtension); } + + private static void ForceZipFileToReleaseAllFileHandles() + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + } } } \ No newline at end of file