public static void LoadAndRegisterAssemblyFrom(File assemblyFile, ClassLoader classLoader) { string assemblyPath = new Uri(assemblyFile.getCanonicalFile().toURI().toString()).LocalPath; Assembly assembly; if (System.IO.File.Exists(assemblyPath)) { assembly = Assembly.LoadFrom(assemblyPath); } else { string current = Path.Combine(homeDir, assemblyPath); if (System.IO.File.Exists(current)) { assembly = Assembly.LoadFrom(current); } else { throw new FileNotFoundException(assemblyPath); } } if (knownAssemblies.ContainsKey(assembly)) { if (Setup.Verbose) { Console.WriteLine("skipped " + assembly + " from " + assembly.Location); } return; } if (Setup.Verbose) { Console.WriteLine("loading " + assembly + " from " + assembly.Location); } knownAssemblies.Add(assembly, assembly); Registry.RegisterAssembly(assembly, true, classLoader); if (Setup.Verbose) { Console.WriteLine("loaded " + assembly + " from " + assembly.Location); } }
public static void LoadAndRegisterAssemblyFromClassLoader(File assemblyFile, ClassLoader classLoader) { string assemblyPath = new Uri(assemblyFile.getCanonicalFile().toURI().toString()).LocalPath; Assembly assembly; if (System.IO.File.Exists(assemblyPath)) { assembly = Assembly.LoadFrom(assemblyPath); } else { string current = Path.Combine(homeDir, assemblyPath); if (System.IO.File.Exists(current)) { assembly = Assembly.LoadFrom(current); } else { throw new FileNotFoundException(assemblyPath); } } RegisterAssembly(assembly, classLoader); }
public static void LoadAndRegisterAssemblyFromClassLoader(File assemblyFile, ClassLoader classLoader) { string assemblyPath = new Uri(assemblyFile.getCanonicalFile().toURI().toString()).LocalPath; Assembly assembly; if (System.IO.File.Exists(assemblyPath)) { assembly = Assembly.LoadFrom(assemblyPath); } else { string current = Path.Combine(homeDir, assemblyPath); if (System.IO.File.Exists(current)) { assembly = Assembly.LoadFrom(current); } else { throw new FileNotFoundException(assemblyPath); } } RegisterAssembly(assembly, classLoader); }
public static void LoadAndRegisterAssemblyFrom(File assemblyFile, ClassLoader classLoader) { string assemblyPath = new Uri(assemblyFile.getCanonicalFile().toURI().toString()).LocalPath; Assembly assembly; if (System.IO.File.Exists(assemblyPath)) { assembly = Assembly.LoadFrom(assemblyPath); } else { string current = Path.Combine(homeDir, assemblyPath); if (System.IO.File.Exists(current)) { assembly = Assembly.LoadFrom(current); } else { throw new FileNotFoundException(assemblyPath); } } if (knownAssemblies.ContainsKey(assembly)) { if (Setup.Verbose) { Console.WriteLine("skipped " + assembly + " from " + assembly.Location); } return; } if (Setup.Verbose) { Console.WriteLine("loading " + assembly + " from " + assembly.Location); } knownAssemblies.Add(assembly, assembly); Registry.RegisterAssembly(assembly, true, classLoader); if (Setup.Verbose) { Console.WriteLine("loaded " + assembly + " from " + assembly.Location); } }