Bug 59664 - Type.GetType("", true) throws ArgumentException on Mono but TypeLoadException on .NET
Summary: Type.GetType("", true) throws ArgumentException on Mono but TypeLoadException...
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: PC All
: --- normal
Target Milestone: Future Release
Assignee: Aleksey Kliger
Depends on:
Reported: 2017-09-21 19:03 UTC by Alexander Köplinger [MSFT]
Modified: 2017-10-12 14:39 UTC (History)
4 users (show)

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

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:

Description Alexander Köplinger [MSFT] 2017-09-21 19:03:52 UTC
Repro code on Mono:

> Type.GetType("", true);
> System.ArgumentException: failed parse:
> Parameter name: typeName
>   at (wrapper managed-to-native) System.Type:internal_from_name (string,bool,bool)
>   at System.Type.GetType (System.String typeName, System.Boolean throwOnError) [0x0000e] in <9cd3f0116feb4ec390b57168913a653e>:0

Compare with .NET:

> System.TypeLoadException: A null or zero length string does not represent a valid Type.

Reenable https://github.com/xamarin/ms-test-suite/blob/master/systemruntimebringup/TypeGetType3/TypeGetType3.cs#L52 when this is fixed.
Comment 1 Aleksey Kliger 2017-10-11 15:25:33 UTC
Fixed on mono master https://github.com/mono/mono/commit/0c61eb1b122b8d98e2e3ad3f443c97bd21e471b2

2017-10 and 2017-08 in progress...
Comment 2 Aleksey Kliger 2017-10-12 14:39:05 UTC
Fixed on mono 2017-10 https://github.com/mono/mono/commit/5eed3a54c5361247decb7eb0c50fe86f39a9c7fa

Not going to do a fix for 2017-08 see https://github.com/mono/mono/pull/5768#issuecomment-336038087