Bug 580

Summary: Type.Load loads strong type despite version mismatch
Product: [Mono] Runtime Reporter: knittl89+bugs
Component: ReflectionAssignee: Aleksey Kliger <aleksey>
Severity: major CC: deleted, masafa, mono-bugs+mono, mono-bugs+runtime
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: test case project

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.