Bug 55911 - Could not load file or assembly 'System.Runtime' or one of its dependencies
Summary: Could not load file or assembly 'System.Runtime' or one of its dependencies
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: Master
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-05-03 09:10 UTC by feiin
Modified: 2017-05-13 10:40 UTC (History)
2 users (show)

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


Attachments
test2 lib was Portable Library and test project tagert framework need use .net framework 4.6 / 4.6.x (1.01 MB, application/zip)
2017-05-03 09:10 UTC, feiin
Details


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 ANSWERED

Description feiin 2017-05-03 09:10:26 UTC
Created attachment 21918 [details]
test2 lib was Portable Library and test project tagert framework need use .net framework 4.6 / 4.6.x

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime' or one of its dependencies
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x0006f] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/AppDomain.cs:746
  at at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence)
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/AppDomain.cs:714
  at at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
  at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/Assembly.cs:600
  at ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1[T] assemblies, System.Reflection.Assembly assembly) [0x0006d] in /Users/builder/data/lanes/4691/675645b0/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:441
  at ObjCRuntime.Runtime.CollectReferencedAssemblies (System.Collections.Generic.List`1[T] assemblies, System.Reflection.Assembly assembly) [0x0006d] in /Users/builder/data/lanes/4691/675645b0/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:441
  at ObjCRuntime.Runtime.RegisterEntryAssembly (System.Reflection.Assembly entry_assembly) [0x00035] in /Users/builder/data/lanes/4691/675645b0/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:402
  at ObjCRuntime.Runtime.RegisterAssemblies () [0x00006] in /Users/builder/data/lanes/4691/675645b0/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:378
  at AppKit.NSApplication.Init () [0x00022] in /Users/builder/data/lanes/4691/675645b0/source/xamarin-macios/src/AppKit/NSApplication.cs:59
  at Breeze2OSX.MainClass.Main (System.String[] args) [0x00001] in

 /Users/xxx/work/xxx/xx/Main.cs:12



xamarin 6.3(build 864) 【using xamarin 6.3(build 863 ) is OK】


=== Xamarin Studio Community ===

Version 6.3 (build 864)
Installation UUID: 1ec5cb2d-f7fe-4e4b-b72f-d3402d820589
Runtime:
	Mono 5.0.0.78 (2017-02/ba317ed) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000078

=== NuGet ===

Version: 3.5.0.0

=== Xamarin.Profiler ===

'/Applications/Xamarin Profiler.app' not found

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.iOS ===

Version: 10.10.0.21 (Xamarin Studio Community)
Hash: 675645b0
Branch: d15-2
Build date: 2017-04-22 14:32:46-0400

=== Xamarin.Android ===

Version: 7.3.0.11 (Xamarin Studio Community)
Android SDK: /Users/yangyin/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.4   (API level 19)
		5.0   (API level 21)
		6.0   (API level 23)
		7.0   (API level 24)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 23.0.1

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)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 3.4.0.21 (Xamarin Studio Community)

=== Xamarin Inspector ===

Not Installed

=== Build Information ===

Release ID: 603000864
Git revision: 6c2f6737278ccc3e81e12276d49c0d92f975f189
Build date: 2017-04-24 11:26:01-04
Xamarin addins: d8d46e577d8507c35260ce9d73df3c33415bb214
Build lane: monodevelop-lion-d15-1

=== Operating System ===

Mac OS X 10.12.4
Darwin yangyindeMacBook-Pro.local 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 1 Chris Hamons 2017-05-03 15:21:05 UTC
Much of the improved PCL / Netstandard support in Xamarin.Mac currently requires use of msbuild instead of xbuild. I believe this use case is one, as:

msbuild test.sln
test/bin/Debug/test.app/Contents/MacOS/test

works when I use Xamarin.Mac from Alpha/beta but

xbuild test.sln
test/bin/Debug/test.app/Contents/MacOS/test

does not.

Please confirm that this works on your end. If so, you can swap the default in Xamarin Studio in the Preferences -> Project -> Build -> Build with MSBuild instead of xbuild (EXPERIMENTAL) option. 

new monos are already warning:

>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

and Visual Studio for Mac defaults to msbuild now, so this option is less scary than currently written.
Comment 2 feiin 2017-05-13 04:37:46 UTC
still not working , I will try Visual studio from mac
Comment 3 feiin 2017-05-13 10:40:48 UTC
work correctly with Visual Studio for mac