3

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
Maloric
  • 5,525
  • 3
  • 31
  • 46

1 Answers1

5

Upgrade to Mono 4.0.1 or greater.

natemcmaster
  • 25,673
  • 6
  • 78
  • 100
  • I tried installing the latest version of mono from http://www.mono-project.com but still get the same version when I type `mono --version`. I don't know where the existing version of mono comes from unless it is part of the dnx runtime, so am not sure how to uninstall it or force mono to use the new installation. – Maloric Jul 08 '15 at 13:01
  • Run `which mono`. This will tell you which command you are executing. – natemcmaster Jul 08 '15 at 20:45
  • You can also run ``readlink `which mono` `` to get the path where this is pointing. – natemcmaster Jul 09 '15 at 00:18
  • Doing the above I realised that I had version 3.12.1 installed via brew. Since this appears to be the latest version on brew at present, I uninstalled it, and now mono uses the version I installed manually. `dnu restore` now works perfectly. Thanks. – Maloric Jul 09 '15 at 08:30