[Mono-bugs] [Bug 39926][Nor] New - Activator.CreateInstance assemblyName=null

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 18 Mar 2003 16:34:29 -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 jean-marc.andre@polymtl.ca.

http://bugzilla.ximian.com/show_bug.cgi?id=39926

--- shadow/39926	Tue Mar 18 16:34:29 2003
+++ shadow/39926.tmp.26247	Tue Mar 18 16:34:29 2003
@@ -0,0 +1,79 @@
+Bug#: 39926
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: RedHat 8.0
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jean-marc.andre@polymtl.ca               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Activator.CreateInstance assemblyName=null
+
+Description of Problem:
+The Activator.CreateInstance methods should accept a null value as first
+parameter (the one describing the assembly name).
+If the parameter is null, the runtime looks for the desired type in the
+executing assembly.
+I think that the bug can be fixed by adding 3 lines to the Activator.cs file.
+
+Steps to reproduce the problem:
+1.
+using System;
+using System.Runtime.Remoting;
+
+namespace ActivatorTest
+{
+	public class ActivatorTestObject
+	{
+		public ActivatorTestObject(){}
+		public ActivatorTestObject(int id, string desc)
+		{
+			_id = id;
+			_desc = desc;
+		}
+		public int Id
+		{
+			get{ return _id;}
+		}
+		public string Desc
+		{
+			get{ return _desc;}
+		}
+		private int _id = 0;
+		private string _desc = null;
+	}
+
+	public class ActivatorTest
+	{
+		public static void Main()
+		{
+			object[] objArgs = new object[2];
+			objArgs[0]=1;
+			objArgs[1]="coucou";
+			ObjectHandle hObject = Activator.CreateInstance(null,
+"ActivatorTest.ActivatorTestObject", objArgs);
+			ActivatorTestObject objTest = (ActivatorTestObject) hObject.Unwrap();
+		}
+	}
+}
+
+2. 
+3. 
+
+Actual Results:
+the application craches if runs with mono
+
+Expected Results:
+
+
+How often does this happen? 
+always
+
+Additional Information: