Bug 55436

Summary: System.Runtime refuses to load with strict naming
Product: [Mono] Runtime Reporter: Andi McClure <andi.mcclure>
Component: GeneralAssignee: Aleksey Kliger <aleksey>
Severity: normal CC: masafa, mono-bugs+mono, mono-bugs+runtime
Priority: ---    
Version: 5.2 (2017-04)   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: 2017-04 Is this bug a regression?: ---
Last known good build:

Description Andi McClure 2017-04-20 20:51:17 UTC
There is a macios test which you can run from the xamarin-macios repository with

(cd tests && (MONO_LOG_MASK=asm MONO_LOG_LEVEL=debug ./common/mac/TestProjects/ImmutableCollection_Test/ImmutableCollection_Test/bin/Debug/ImmutableCollection_Test.app/Contents/MacOS/ImmutableCollection_Test))

It builds a mac app which references System.Collections.Immutable. The mac app has mono and directly and indirectly referenced assemblies such as System.Collections.Immutable copied into it. When you build the app using the mono-2017-04 branch of xamarin-macios (the first to contain strong assembly naming rules) and run the app, it fails saying it cannot find System.Runtime:


If you look carefully, the reason this happens is because the version of System.Runtime copied into the .app is, but whoever referenced it used the strong name at build time.

Our understanding is that this is not a bug in the assembly loaders but is a problem with the BCL we are distributing. Aleksey and Koeplinger believe this is something to do with the version numbers we assign facades. The possibility was raised that the facades are not in the remap table and this is the problem. It also might be that this is an early canary for a problem which will get more noticeable once strong name restrictions are added to all assembly loading paths.
Comment 1 Marek Safar 2017-04-24 08:56:38 UTC
I think https://github.com/mono/mono/pull/4730 could address this issue too
Comment 2 Aleksey Kliger 2017-04-24 17:57:18 UTC
Yes, this will be fixed by that PR.