[Mono-bugs] [Bug 36109][Nor] Changed - Activator.CreateInstance returns null
26 Dec 2002 07:10:09 -0000
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by email@example.com.
--- shadow/36109 Thu Dec 26 00:37:55 2002
+++ shadow/36109.tmp.5896 Thu Dec 26 02:10:08 2002
@@ -1,14 +1,14 @@
Product: Mono/Class Libraries
@@ -60,6 +60,23 @@
listed exceptions, we weren't expecting that CreateInstance might be returning null.
------- Additional Comments From firstname.lastname@example.org 2002-12-26 00:37 -------
Created an attachment (id=3035)
+------- Additional Comments From email@example.com 2002-12-26 02:10 -------
+I found several places in Activator.cs where CreateInstance returns null. I
+created a patch file that throws the MissingMethodException if an appropriate
+constructor is not found. The Rotor docs also indicate some other exceptions
+that provide finer-grained information about that failed, but I wasn't sure how
+to handle that.
+I also noticed that CreateInstanceFrom() returns null under some
+circumstances. Unlike the case of CreateInstance(), the docs are not consistent
+about whether CreateInstanceFrom()... In the method
+CreateInstanceFrom(string assemblyFile, string typeName), it is mentioned
+that null may be return if the requested type cannot be created, but no
+mention of null is given in the other overloads. However, there are exceptions
+that can be throw in various cases I didn't do anything with the
+CreateInstanceFrom() methods because someone more experienced needs to
+look at those, perhaps.