Bug 55436 - System.Runtime refuses to load with strict naming
Summary: System.Runtime refuses to load with strict naming
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 5.2 (2017-04)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Aleksey Kliger
URL:
Depends on:
Blocks:
 
Reported: 2017-04-20 20:51 UTC by Andi McClure
Modified: 2017-04-26 00:58 UTC (History)
3 users (show)

See Also:
Tags: 2017-04
Is this bug a regression?: ---
Last known good build:


Attachments

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 4.1.0.0, but whoever referenced it used the 4.0.0.0 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.

Note You need to log in before you can comment on or make changes to this bug.