do not bundle mscorlib.dll that is running mkbundle.exe. Bundle explicitly passed...
authorAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Fri, 15 Jun 2012 13:02:58 +0000 (22:02 +0900)
committerAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Fri, 15 Jun 2012 13:02:58 +0000 (22:02 +0900)
mcs/tools/mkbundle/mkbundle.cs

index 0e565c6a59165809d6aca91f156536361cc3ed26..47365ca07c316266468a2645d69a1e200e3112f3 100644 (file)
@@ -144,6 +144,23 @@ class MakeBundle {
                ArrayList files = new ArrayList ();
                foreach (Assembly a in assemblies)
                        QueueAssembly (files, a.CodeBase);
+                       
+               // Special casing mscorlib.dll: any specified mscorlib.dll cannot be loaded
+               // by Assembly.ReflectionFromLoadFrom(). Instead the fx assembly which runs
+               // mkbundle.exe is loaded, which is not what we want.
+               // So, replace it with whatever actually specified.
+               foreach (string srcfile in sources) {
+                       if (Path.GetFileName (srcfile) == "mscorlib.dll") {
+                               foreach (string file in files) {
+                                       if (Path.GetFileName (new Uri (file).LocalPath) == "mscorlib.dll") {
+                                               files.Remove (file);
+                                               files.Add (new Uri (Path.GetFullPath (srcfile)).LocalPath);
+                                               break;
+                                       }
+                               }
+                               break;
+                       }
+               }
 
                GenerateBundles (files);
                //GenerateJitWrapper ();