Author: sandervanderburg
Date: Tue Sep 13 20:07:14 2011
New Revision: 29249
URL: https://ssl.nixos.org/websvn/nix/?rev=29249&sc=1

Log:
Removed some obsolete restrictions, so that transitive dependencies are also 
loaded

Modified:
   nixpkgs/trunk/pkgs/build-support/dotnetenv/Wrapper/Wrapper/Wrapper.cs.in

Modified: 
nixpkgs/trunk/pkgs/build-support/dotnetenv/Wrapper/Wrapper/Wrapper.cs.in
==============================================================================
--- nixpkgs/trunk/pkgs/build-support/dotnetenv/Wrapper/Wrapper/Wrapper.cs.in    
Tue Sep 13 19:29:13 2011        (r29248)
+++ nixpkgs/trunk/pkgs/build-support/dotnetenv/Wrapper/Wrapper/Wrapper.cs.in    
Tue Sep 13 20:07:14 2011        (r29249)
@@ -40,37 +40,25 @@
 
         private Assembly MyResolveEventHandler(object sender, ResolveEventArgs 
args)
         {
-            //This handler is called only when the common language runtime 
tries to bind to the assembly and fails.
+            // This handler is called only when the common language runtime 
tries to bind to the assembly and fails.
 
-            //Retrieve the list of referenced assemblies in an array of 
AssemblyName.
             Assembly MyAssembly;
-            string assemblyPath = "";
+            String assemblyPath = "";
+            String requestedAssemblyName = args.Name.Substring(0, 
args.Name.IndexOf(","));
 
-            AssemblyName[] referencedAssemblies = 
exeAssembly.GetReferencedAssemblies();
-
-            //Loop through the array of referenced assembly names.
-            foreach (AssemblyName assemblyName in referencedAssemblies)
+            // Search for the right path of the library assembly
+            foreach (String currentAssemblyPath in AssemblySearchPaths)
             {
-                //Check for the assembly names that have raised the 
"AssemblyResolve" event.
-                if (assemblyName.FullName.Substring(0, 
assemblyName.FullName.IndexOf(",")) == args.Name.Substring(0, 
args.Name.IndexOf(",")))
-                {
-                    //Retrieve the name of the assembly from where it has to 
be loaded.                                
-                    String dllName = args.Name.Substring(0, 
args.Name.IndexOf(",")) + ".dll";
-
-                    //Search for the right path of the library assembly
-                    foreach (String currentAssemblyPath in AssemblySearchPaths)
-                    {
-                        assemblyPath = currentAssemblyPath + "/" + dllName;
-                        if (File.Exists(assemblyPath))
-                            break;
-                    }
-                }
+                assemblyPath = currentAssemblyPath + "/" + 
requestedAssemblyName + ".dll";
+
+                if (File.Exists(assemblyPath))
+                    break;
             }
 
-            //Load the assembly from the specified path.                       
                
+            // Load the assembly from the specified path.                      
                
             MyAssembly = Assembly.LoadFrom(assemblyPath);
 
-            //Return the loaded assembly.
+            // Return the loaded assembly.
             return MyAssembly;
         }
 
_______________________________________________
nix-commits mailing list
nix-comm...@cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to