2016-03-30 79 views
1

我想使用cpack命令从“app.nuspec”文件构建一个自包含的“app.nupkg”包。这里是我的应用程序的目录树:为什么Chocolatey不能包装一个〜2GB的独立包装?

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 

任何帮助吗?谢谢

回答

0

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

它可能只是巧克力,但我怀疑它,因为它被构建为AnyCPU,这意味着在64位时x64。

我见过一些人做了一些巧妙的事情,需要一个6GB的iso并将其拆分成多个包,这是依赖于主包的多个包。

+0

其实“dist”文件有2.7GB大小。有没有参考/链接意识到可以指向正确的方向来尝试解决这个问题? – diegus

相关问题