[Mono-bugs] [Bug 51814][Wis] New - CreateInstanceAndUnwrap throws System.NullReferenceException
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 6 Dec 2003 17:51:52 -0500 (EST)
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 jcornado@yahoo.com.
http://bugzilla.ximian.com/show_bug.cgi?id=51814
--- shadow/51814 2003-12-06 17:51:52.000000000 -0500
+++ shadow/51814.tmp.2228 2003-12-06 17:51:52.000000000 -0500
@@ -0,0 +1,74 @@
+Bug#: 51814
+Product: Mono/Runtime
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: jcornado@yahoo.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: CreateInstanceAndUnwrap throws System.NullReferenceException
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+The call to System.AppDomain.CreateInstanceAndUnwrap throws the previously
+mentioned exception. It DOES NOT print a stack trace either.
+
+According to the MSDN docs, this is not one of the 4 or 5 exceptions that
+this method could throw.
+
+Background info:
+
+Mono 0.29
+Redhat 8.0 running 2.4.20
+Assemblies with no stong naming, and residing in the same dir.
+Assembly 1: driver.exe (namespace: namespace1)
+Assembly 2: namespace1.library.dll (namespace: namespace1.library)
+Command line: mono output/Driver.exe default.build
+
+I tried the following:
+
+thePseudoProcessInstances[Counter1] = //Where This array subscript holds a
+AppDomain successfully created
+(library.PseudoProcessInstance) // Where PseudoProcessInstance is a class
+with a constructtor that takes a string and prints it out (it subclasses
+MarshalByRefObject)
+thePseudoProcess[Counter1].CreateInstanceAndUnwrap(
+"namespace1.library",
+"namespace1.library.PseudoProcessInstance",
+false, //Do not Ignore case sensitivity
+System.Reflection.BindingFlags.CreateInstance |
+System.Reflection.BindingFlags.ExactBinding |
+System.Reflection.BindingFlags.Default //I tried 0 (zero) also
+,
+System.Type.DefaultBinder, //tried null also
+Temp, // An Object[1] that holds a string
+System.Globalization.CultureInfo.CurrentCulture, //tried null also
+null,
+System.Reflection.Assembly.GetExecutingAssembly().Evidence //tried null also
+);
+
+
+
+
+Actual Results:
+
+The constructor is successfully called in the corresponding AppDomain, but
+the function returns null and throws the exception
+
+Expected Results:
+
+A NON-NULL namespace1.library.PseudoProcessInstance and no exception thrown
+
+How often does this happen?
+
+Repeatedly