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.

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

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.

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