[Mono-bugs] [Bug 80265][Nor] New - AppDomain.TypeResolve event raised for System.Int32

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Dec 15 04:55:03 EST 2006


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 rolfkvinge at ya.com.

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

--- shadow/80265	2006-12-15 04:55:03.000000000 -0500
+++ shadow/80265.tmp.15117	2006-12-15 04:55:03.000000000 -0500
@@ -0,0 +1,54 @@
+Bug#: 80265
+Product: Mono: Class Libraries
+Version: 1.0
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: rolfkvinge at ya.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: AppDomain.TypeResolve event raised for System.Int32
+
+The following code causes typeresolve event to occur on Mono, but not on 
+MS.
+
+Notes: 
+- msdn for AppDomain.TypeResolve says the event can occur if the typename 
+is not qualified with the assembly name, but for Type.GetType it says that 
+the assembly name is not required for types in mscorlib.
+- this code is from the wiki: http://www.mono-project.com/
+FAQ:_Technical#How_can_I_detect_if_am_running_in_Mono.3F, so it should 
+really work :)
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Text;
+
+namespace vbnc_bugs
+{
+	class Program
+	{
+		static void Main (string [] args)
+		{
+			AppDomain.CurrentDomain.TypeResolve += new 
+ResolveEventHandler (CurrentDomain_TypeResolve);
+			Type intType = Type.GetType ("System.Int32");
+			Console.WriteLine (intType.FullName);
+		}
+
+		static Assembly CurrentDomain_TypeResolve (object sender, 
+ResolveEventArgs args)
+		{
+			throw new Exception ("Resolving " + args.Name);
+		}
+	}
+}


More information about the mono-bugs mailing list