From: Aleksey Kliger (λgeek) Date: Tue, 16 Jul 2019 18:30:16 +0000 (-0400) Subject: [netcore] Use the strict loader (mono/mono#15668) X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~973 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=434df5b15ed2f86e3166118d62890502110cb4c6;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [netcore] Use the strict loader (mono/mono#15668) Mono historically was quite lax in how it resolved assembly references - it would pick the first assembly with a matching simple name. The "strict" mode (available in framework Mono with `--assembly-loader=strict`) follows the spec behavior: the version and public key token of the candidate assembly must match what is requested. Commit migrated from https://github.com/mono/mono/commit/d8a679375d706e992d590c3eb90e1c57cb2864e7 --- diff --git a/src/mono/mono/mini/main-core.c b/src/mono/mono/mini/main-core.c index e0f01d3..6ac0f1e 100644 --- a/src/mono/mono/mini/main-core.c +++ b/src/mono/mono/mini/main-core.c @@ -227,6 +227,12 @@ int STDAPICALLTYPE coreclr_initialize (const char* exePath, const char* appDomai if (native_lib_paths != NULL) mono_set_pinvoke_search_directories (native_lib_paths->dir_count, native_lib_paths->dirs); + /* + * Don't use Mono's legacy assembly name matching behavior - respect + * the requested version and public key token. + */ + mono_loader_set_strict_strong_names (TRUE); + return 0; }