[Mono-bugs] [Bug 66237][Maj] New - remapping issue for assemblies targeting .NET 1.0 / 1.1 on Mono 2.0 profile

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 19 Sep 2004 09:09:50 -0400 (EDT)


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 gert.driesen@pandora.be.

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

--- shadow/66237	2004-09-19 09:09:50.000000000 -0400
+++ shadow/66237.tmp.7489	2004-09-19 09:09:50.000000000 -0400
@@ -0,0 +1,90 @@
+Bug#: 66237
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: remapping issue for assemblies targeting .NET 1.0 / 1.1 on Mono 2.0 profile
+
+There's an major issue with how remapping of assemblies built using 
+previous versions of an .NET Framework or Mono is implemented (in 
+assembly.c).
+
+Right now, only assemblies with a assembly name starting with "System" 
+and build version equals to 3300 are remapped to build number 5000.
+
+However, when running on the 2.0 profile (runtime) both assemblies built 
+using .NET 1.0 (or Mono pre 1.0) or .NET 1.1 (Mono 1.0 profile) should be 
+remapped to .NET 2.0 / Mono 2.0 profile assemblies.
+
+Otherwise, you get really freaky results as you can have an appication 
+running on the 2.0 profile which is using assemblies from the 1.0 profile 
+(as demonstrated by the attached test cases).
+
+I've attached a (gzipped) tar containing two test apps :
+
+- test1 references an .NET 1.0 assembly, and outputs a list of the loaded 
+assemblies
+
+- test2 also references a .NET 1.0 assembly, and uses a .NET 2.0 type
+
+To reproduce this issue just extract the attached tar and run make.
+
+test1 output the following :
+
+Compat mode: the request from /home/gert/mono-test-
+projects/bugnew2/log4net.dll to load System.Xml was remapped 
+(http://www.go-mono.com/remap.html)
+Compat mode: the request from /home/gert/mono-test-
+projects/bugnew2/log4net.dll to load System was remapped (http://www.go-
+mono.com/remap.html)
+Loaded assemblies:
+log4net, Version=1.2.1.40796, Culture=neutral, 
+PublicKeyToken=aaa0f432407c68df
+test1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+System, Version=1.0.5000.0, Culture=neutral, 
+PublicKeyToken=b77a5c561934e089
+System.Xml, Version=1.0.5000.0, Culture=neutral, 
+PublicKeyToken=b77a5c561934e089
+mscorlib, Version=2.0.3600.0, Culture=neutral, 
+PublicKeyToken=b77a5c561934e089
+
+as you can see, there's a mix of both 1.1 and 2.0 assemblies.
+
+test2 results in the following error :
+
+Compat mode: the request from /home/gert/mono-test-
+projects/bugnew2/log4net.dll to load System.Xml was remapped 
+(http://www.go-mono.com/remap.html)
+Compat mode: the request from /home/gert/mono-test-
+projects/bugnew2/log4net.dll to load System was remapped (http://www.go-
+mono.com/remap.html)
+
+** (test2.exe:18465): WARNING **: Could not load class from token 
+0x01000007 in /home/gert/mono-test-projects/bugnew2/test2.exe
+
+** ERROR **: file class.c: line 1323 (mono_class_init): assertion failed: 
+(class)
+aborting...
+make: *** [run-test2] Killed
+
+This is because as part of the remapping mechanism the reference to the 
+1.0 System and System.Xml assemblies were resolved to the 1.1 System and 
+System.Xml assemblies. And when the runtime then tries to initialize the 
+System.Configuration.ConfigurationSection class (from the 2.0 profile 
+System assembly)it cannot because the 1.0 profile System assembly is 
+loaded and that assembly does not contain a 
+System.Configuration.ConfigurationSection type.
+
+PS. I hope it was ok to set the priority of this bug report to Major, if 
+not : my apologies ...