为什么Chocolatey无法包装~2GB的独立包装?

时间:2016-03-30 08:07:02

标签: windows chocolatey cpack

我想建立一个独立的" app.nupkg"包装来自" app.nuspec"文件使用cpack命令。这是我的应用程序的目录树:

C:\CHOCO_REPO\APP
│   app.nuspec
│
├───bin
│       dist
│       Setup.exe
│
└───tools
        chocolateyinstall.ps1
        chocolateyuninstall.ps1

dist文件(大小~2G)实际上是程序。当我尝试跑步时:

cpack app.nupgk

我明白了:

bin\dist
Cannot access a closed stream

带有调试选项:

cpack app.nuspec -d

我明白了:

Attempting to build package from 'app.nuspec'.
bin\dist
Attempting to delete  file "C:\choco_repo\APP\app.nupkg".
Chocolatey had an error occur:
System.ObjectDisposedException: Can not access a closed Stream.
at System.IO.Compression.DeflateStream.EnsureNotDisposed()
at MS.Internal.IO.Packaging.CompressStream.Flush()
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.FlushExposedStreams()
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.UpdateReferences(Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOBlockManager.SaveContainer(Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOBlockManager.SaveStream(ZipIOLocalFileBlock blockRequestingFlush, Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Packaging.PackagePart.Close()
at System.IO.Packaging.Package.DoClose(PackagePart p)
at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation)
at System.IO.Packaging.Package.System.IDisposable.Dispose()
at NuGet.PackageBuilder.Save(Stream stream)
at chocolatey.infrastructure.app.nuget.NugetPack.BuildPackage(PackageBuilder builder, IFileSystem fileSystem, String outputPath)
at chocolatey.infrastructure.app.services.NugetService.pack_run(ChocolateyConfiguration config)
at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action`1 parseArgs)
at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container)
at chocolatey.console.Program.Main(String[] args)
Exiting with 1

有任何帮助吗?谢谢

1 个答案:

答案 0 :(得分:0)

可能是大小。 NuGet和.NET在程序包的大小方面有一些限制。

它可能只是Choco,但我怀疑它,因为它是作为AnyCPU构建的,这意味着64位时的x64。

我已经看到一些人做了一些巧妙的事情来获取6GB iso并将其分成多个包,这些包是主包的依赖。