Maloric
Maloric

Reputation: 5625

DNU Restore Unknown Header on OSX Yosemite

I've tried a couple of times to get .Net running on my MacBook using instructions found on the official Asp.Net docs and elsewhere. The latest attempt was using the Yeoman generator instructions found here.

However when I try to run DNU Restore, I am always presented with the same error, albeit for a different library. The error is "unknown header: " followed by a number that differs depending on the library. Here is one example (only the first few and last few lines included for brevity):

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/

I've tried deleting the contents of ~/.dnx/packages and removing old versions of dnx from ~/.dnx/runtimes. At present I am using the 1.0.0-beta6-12170 runtime.

Has anyone else had a similar problem or figured out how to fix it?

EDIT:

Here is the output of dnvm list:

Active Version              Runtime Arch Location             Alias
------ -------              ------- ---- --------             -----
  *    1.0.0-beta6-12170    mono         ~/.dnx/runtimes      default

Here is the output of 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

Upvotes: 3

Views: 447

Answers (1)

natemcmaster
natemcmaster

Reputation: 26823

Upgrade to Mono 4.0.1 or greater.

Upvotes: 5

Related Questions