diff --git a/src/chocolatey/infrastructure.app/nuget/NugetPack.cs b/src/chocolatey/infrastructure.app/nuget/NugetPack.cs index 7b37a72d2b..df01400710 100644 --- a/src/chocolatey/infrastructure.app/nuget/NugetPack.cs +++ b/src/chocolatey/infrastructure.app/nuget/NugetPack.cs @@ -36,6 +36,11 @@ public static IPackage BuildPackage(PackageBuilder builder, IFileSystem fileSyst { using (Stream stream = fileSystem.create_file(outputPath)) { + // Truncate if needed, as Mono fails to truncate + if (stream.Length > 0) + { + stream.SetLength(0); + } builder.Save(stream); } }