Bug 580 - Type.Load loads strong type despite version mismatch
Summary: Type.Load loads strong type despite version mismatch
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection (show other bugs)
Version: unspecified
Hardware: PC Linux
: Normal major
Target Milestone: ---
Assignee: Aleksey Kliger
URL:
Depends on:
Blocks:
 
Reported: 2011-09-01 06:18 UTC by knittl89+bugs
Modified: 2017-04-26 00:59 UTC (History)
4 users (show)

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


Attachments
test case project (8.42 KB, application/x-compressed-tar)
2011-09-01 06:18 UTC, knittl89+bugs
Details

Description knittl89+bugs 2011-09-01 06:18:40 UTC
Created attachment 228 [details]
test case project

Type.Load("Assembly.Type, Assembly, Version=x.x.x.x"); loads a type even when the requested version is different from the (strongly named) assembly version.

.NET runtime throws a FileLoadException:

> Could not load file or assembly 'StrongAssembly, Version=1.0.9999.9999'
> or one of its dependencies. The located assembly's manifest definition 
> does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Mono runtime loads the type without any sign of error.

A simple test project exhibiting the bug is attached
Comment 1 Aleksey Kliger 2017-04-12 21:43:14 UTC
Not a duplicate of bug 49721, sadly, because it looks like I missed one branch of control flow in the assembly loader.

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