我已经尝试了几次使用官方Asp.Net文档和其他地方的说明在我的MacBook上运行.Net。最新的尝试是使用here找到的Yeoman生成器指令。
但是当我尝试运行DNU Restore时,我总是会遇到相同的错误,尽管对于不同的库。错误是“unknown header:”后跟一个根据库而不同的数字。这是一个例子(为了简洁,仅包括前几个和最后几行):
Error: DownloadPackageAsync: https://www.nuget.org/api/v2/package/Microsoft.AspNet.Loader.IIS/1.0.0-beta5
Unknown header: 3649249205
----------
System.NotSupportedException: Unknown header: 3649249205
at SharpCompress.Common.Zip.ZipHeaderFactory.ReadHeader (UInt32 headerBytes, System.IO.BinaryReader reader) [0x00000] in <filename unknown>:0
at SharpCompress.Common.Zip.SeekableZipHeaderFactory+<ReadSeekableHeader>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at SharpCompress.Archive.Zip.ZipArchive+<LoadEntries>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
at SharpCompress.LazyReadOnlyCollection`1+LazyLoader[SharpCompress.Archive.Zip.ZipArchiveEntry].MoveNext () [0x00000] in <filename unknown>:0
at System.IO.Compression.ZipArchive.CreateZip (System.IO.Stream stream, ZipArchiveMode mode) [0x00000] in <filename unknown>:0
at System.IO.Compression.ZipArchive..ctor (System.IO.Stream stream, ZipArchiveMode mode, Boolean leaveOpen) [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.Restore.NuGet.PackageUtilities.EnsureValidPackageContents (System.IO.Stream stream, Microsoft.Framework.PackageManager.PackageInfo package) [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.Restore.NuGet.PackageUtilities+<>c__DisplayClass1_0.<OpenNupkgStreamAsync>b__0 (System.IO.Stream stream) [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.Restore.NuGet.HttpSource+<GetAsync>d__8.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.Restore.NuGet.PackageUtilities+<OpenNupkgStreamAsync>d__1.MoveNext () [0x00000] in <filename unknown>:0
...
Restore failed
Unknown header: 3649249205
NuGet Config files used:
/Users/jamie.morris/.config/NuGet/NuGet.Config
Feeds used:
https://www.myget.org/F/aspnetvnext/api/v2/
https://nuget.org/api/v2/
我尝试删除〜/ .dnx / packages的内容,并从〜/ .dnx / runtimes中删除旧版本的dnx。目前我正在使用1.0.0-beta6-12170
运行时。
是否有其他人遇到类似问题或想出如何修复它?
修改
以下是dnvm list
的输出:
Active Version Runtime Arch Location Alias
------ ------- ------- ---- -------- -----
* 1.0.0-beta6-12170 mono ~/.dnx/runtimes default
以下是mono --version
的输出:
Mono JIT compiler version 3.12.1 (tarball Tue Mar 17 15:03:14 GMT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
答案 0 :(得分:5)
升级到Mono 4.0.1或更高版本。