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)

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


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

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.