Bug 31758 - Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
Summary: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neu...
Status: RESOLVED DUPLICATE of bug 31527
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-07-08 15:15 UTC by Stephen Rawlins
Modified: 2015-07-08 15:36 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 31527

Description Stephen Rawlins 2015-07-08 15:15:41 UTC
=== Xamarin Studio ===

Version 5.9.4 (build 5)
Installation UUID: 69759d01-e512-4032-89db-884a8fdd22ee
Runtime:
	Mono 4.0.2 ((detached/c99aa0c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400020005

Build date: 2015-06-30 15:19:13-0400

=== Xamarin.Android ===

Version: 5.1.4.16 (Business Edition)
Android SDK: /Users/steverawlins/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Location: /Applications/Xamarin Android Player.app

=== Build Information ===

Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

=== Operating System ===

Mac OS X 10.10.3
Darwin Steves-MacBook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Jonathan Pryor 2015-07-08 15:18:40 UTC
A repro is nice, but I bet this is a Dupe of Bug #31527.

*** This bug has been marked as a duplicate of bug 31527 ***
Comment 2 Stephen Rawlins 2015-07-08 15:20:37 UTC
When I switched to Visual Studio 2013 (on a Win81 VM), building the same Android solution, the app built and executed without error, so somehow `System.Runtime` is available.

Same machine (MacBookPro), only difference:  Xamarin Studio for Mac build causes the runtime error while the Windows 8.1 Visual Studio build does not.

Here is the runtime error:

Mono] Assembly Loader probing location: '/Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/builds/install/mono-x86/lib/System.Runtime.exe'.
[Mono] The following assembly referenced from /storage/emulated/0/Android/data/com.x.viewchoices/files/.__override__/x.UI.dll could not be loaded:
[Mono]      Assembly:   System.Runtime    (assemblyref_index=0)
[Mono]      Version:    4.0.0.0
[Mono]      Public Key: b03f5f7f11d50a3a
[Mono] The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/storage/emulated/0/Android/data/com.x.viewchoices/files/.__override__/).
[Mono] Failed to load assembly x.UI[0xb428fbe0]
[Mono] Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
[Mono] Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
[Mono] DllImport attempting to load: '/system/lib/liblog.so'.
[Mono] DllImport loaded library '/system/lib/liblog.so'.
[Mono] DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
[Mono] Searching for '__android_log_print'.
[Mono] Probing '__android_log_print'.
[Mono] Found as '__android_log_print'.
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
[MonoDroid] File name: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
[MonoDroid] at (wrapper managed-to-native) System.Reflection.Emit.DynamicMethod.create_dynamic_method (System.Reflection.Emit.DynamicMethod,System.Reflection.Emit.DynamicMethod) <0x00012>
[MonoDroid] at System.Reflection.Emit.DynamicMethod.CreateDynMethod () <IL 0x000c7, 0x002e3>
[MonoDroid] at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type) <IL 0x0002a, 0x000af>
[MonoDroid] at Android.Runtime.ConstructorBuilder.CreateDelegate (System.Type,System.Reflection.ConstructorInfo,System.Type[]) [0x00117] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Runtime/ConstructorBuilder.cs:40
[MonoDroid] at Java.Interop.TypeManager.n_Activate (intptr,intptr,intptr,intptr,intptr,intptr) [0x000b7] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:155
[MonoDroid] at (wrapper dynamic-method) object.2fc852e1-fbbf-4e3c-8672-2dd3a6b03a3a (intptr,intptr,intptr,intptr,intptr,intptr) <IL 0x00029, 0x0004b>
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable
[AndroidRuntime] Shutting down VM
Comment 3 Stephen Rawlins 2015-07-08 15:36:48 UTC
Following the thread of bug 31527 

I changed Android link options (Project Options / Android Build / Linker)  from "SDK" to "Don't link".   Clean, re-build and it worked this time without runtime error!

Thank you.