Skip to content

Instantly share code, notes, and snippets.

@directhex
Created August 6, 2015 10:09
Show Gist options
  • Save directhex/2bc32d21c0b25fcecdb8 to your computer and use it in GitHub Desktop.
Save directhex/2bc32d21c0b25fcecdb8 to your computer and use it in GitHub Desktop.
Unhandled Exception:
System.BadImageFormatException: Could not resolve field token 0x04000105
File name: 'NuGet.Core'
at NuGet.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.BadImageFormatException: Could not resolve field token 0x04000105
File name: 'NuGet.Core'
at NuGet.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
@paralin
Copy link

paralin commented Aug 27, 2015

Did you ever solve this? I'm having the same problem, not with NuGet though.

@marxin
Copy link

marxin commented Oct 26, 2015

Well, I'm having exactly the same problem with NuGet.exe on Linux system.

@directhex
Copy link
Author

Yes, yes, this issue is resolved!

The short version is "the NuGet.exe package dependencies are being satisfied by mono-devel's codeless PCL assemblies in Mono 4.0+ on RPM-based systems, due to a decade-old bug" - the change which resolves the issue is mono/mono@1f4133a which is applied to upstream Xamarin packages, but not to all distros - and basically every package in the archive needs rebuilding to reflect the change in that patch

@directhex
Copy link
Author

Or, perhaps easier, is to install the windowsbase RPM manually (do not trust your package manager to install it, even though NuGet has it as a requires)

@marxin
Copy link

marxin commented Oct 26, 2015

Thanks for explanation, I can fix openSUSE packages. So if I understand correctly, one needs to have recent mono, which release of mono is the first with the fix applied?

I've been using:
Mono JIT compiler version 4.0.4 (Stable 4.0.4.1/5ab4c0d Thu Sep 3 19:07:26 UTC 2015)

Thanks,
Martin

@marxin
Copy link

marxin commented Oct 26, 2015

Ok, got it 'git log 5ab4c0d' does not contain the commit. I'll update my mono package.

@marxin
Copy link

marxin commented Oct 26, 2015

So after I've updated to:
Mono JIT compiler version 4.2.1 (Stable 4.2.1.60/804ddbc Sun Oct 18 21:49:38 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

I still see the same resolution problem?

@marxin
Copy link

marxin commented Oct 26, 2015

Sorry, my mistake:

git branch --all --contains cdb098617af97c6af76e9048af62e8e5e778b5b6 | grep mono
remotes/origin/mono-4.3.0-branch
remotes/origin/mono-4.3.0-newtls

So that there's not release with the fix out there.

@marxin
Copy link

marxin commented Oct 26, 2015

I can confirm that rebuilt mono package from source works for me ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment