2004-05-01 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Sat, 1 May 2004 18:16:08 +0000 (18:16 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 1 May 2004 18:16:08 +0000 (18:16 -0000)
* assembly.c (mono_assembly_load_references): Add a compatibility
hack to run old applications that might be still referencing the
3300-based assemblies, only do this for System.xxx.

svn path=/trunk/mono/; revision=26524

mono/metadata/ChangeLog
mono/metadata/assembly.c

index 3953e681f5c76595434d3ab84c382d0944ec2bdf..2266a72bd71bbd9182008e0f6a42109bbca0f1cf 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-01  Miguel de Icaza  <miguel@ximian.com>
+
+       * assembly.c (mono_assembly_load_references): Add a compatibility
+       hack to run old applications that might be still referencing the
+       3300-based assemblies, only do this for System.xxx.
+
 2004-05-01  Jackson Harper  <jackson@ximian.com>
 
        * appdomain.c: If the culture is neutral we set it to "".
index f4dcf5e1dc23c6553f64883fd4a0669be6cbcaec..6a758a88a60ad801d0f3e1a2b3a6be6b98b01345 100644 (file)
@@ -320,14 +320,39 @@ mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
 
                if (references [i] == NULL){
                        int j;
-                       
-                       for (j = 0; j < i; j++)
-                               mono_assembly_close (references [j]);
-                       g_free (references);
 
-                       g_warning ("Could not find assembly %s", aname.name);
-                       *status = MONO_IMAGE_MISSING_ASSEMBLYREF;
-                       return;
+                       /*
+                       ** Temporary work around: any System.* which are 3300 build, will get
+                       ** remapped, this is to keep old applications running that might have
+                       ** been linked against our 5000 API, before we were strongnamed, and
+                       ** hence were labeled as 3300 builds by reflection.c
+                       */
+                       if (aname.build == 3300 && strncmp (aname.name, "System", 6) == 0){
+                               aname.build = 5000;
+                               
+                               references [i] = mono_assembly_load (&aname, image->assembly->basedir, status);
+                       }
+                       if (references [i] != NULL){
+                               if (getenv ("MONO_SILENT_WARNING") == NULL)
+                                       g_print ("Compat mode: the request from %s to load %s was remapped (http://www.go-mono.com/remap.html)\n",
+                                                image->name, aname.name);
+                               
+                       } else {
+                       
+                               for (j = 0; j < i; j++)
+                                       mono_assembly_close (references [j]);
+                               g_free (references);
+                               
+                               g_warning ("Could not find assembly %s, references from %s (assemblyref_index=%d)\n"
+                                          "     Major/Minor: %d,%d\n"
+                                          "     Build:       %d,%d\n"
+                                          "     Token:       %s\n",
+                                          aname.name, image->name, i,
+                                          aname.major, aname.minor, aname.build, aname.revision,
+                                          aname.public_tok_value);
+                               *status = MONO_IMAGE_MISSING_ASSEMBLYREF;
+                               return;
+                       }
                }
 
                /*