This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 44729 - Type.GetType("blah",true,false) throws TypeLoadException without message
Summary: Type.GetType("blah",true,false) throws TypeLoadException without message
Status: VERIFIED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: 4.8.0 (C9)
Assignee: Aleksey Kliger
URL:
Depends on:
Blocks:
 
Reported: 2016-09-26 09:59 UTC by Robert van der Boon
Modified: 2016-10-06 12:19 UTC (History)
4 users (show)

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


Attachments

Description Robert van der Boon 2016-09-26 09:59:56 UTC
If I execute the following code:
   Type.GetType("blah", /*throw on error*/true, /*ignoreCase*/false);
I expect a TypeLoadException with a Message starting with:
   "Could not load type 'blah' from assembly '

In mono 4.4.2.11 the Message property is
   "Could not load type 'blah' from assembly ''."

In Microsoft .Net the Message property is
   "Could not load type 'blah' from assembly '{fully qualified name of executing assembly}'."

Since Mono 4.6 the Message property of the exception is empty. (Tested both 4.6.0.245 and master/43ba3b7)

This regression is causing problems in our unit tests.
I've also tried with other arguments (system.string) and the results are the same: mono 4.6+ throws a TypeLoadException with an empty message.

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