|Summary:||System.Runtime refuses to load with strict naming|
|Product:||[Mono] Runtime||Reporter:||Andi McClure <andi.mcclure>|
|Component:||General||Assignee:||Aleksey Kliger <aleksey>|
|Severity:||normal||CC:||masafa, mono-bugs+mono, mono-bugs+runtime|
|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: https://gist.github.com/xmcclure/7424c4d60fa3743e9b5fdf828d581df3 If you look carefully, the reason this happens is because the version of System.Runtime copied into the .app is 18.104.22.168, but whoever referenced it used the 22.214.171.124 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.
Comment 3 Aleksey Kliger 2017-04-26 00:58:49 UTC
Fixed on mono master https://github.com/mono/mono/commit/25bcd22d15d47ff50503631901fb851c97bb03c7 Fixed on mono 2017-04 https://github.com/mono/mono/commit/59ffe0a31618b00da0cc08166bad0d4d33864bf6 Fixed in xamarin-macios mono-2017-04 https://github.com/xamarin/xamarin-macios/pull/1960/commits/677d5f7fc455c82b142fd3a1c3243f3ab2e01c37