private static void CompileModules() { if (Compiled) { return; } ToConsole("Compiling Modules..."); TryCatch( () => { var files = ModulesDirectory.GetFiles("*.dll", SearchOption.AllDirectories); var asm = new List <Assembly>(files.Length); foreach (var file in files) { TryCatch(() => asm.AddOrReplace(Assembly.LoadFrom(file.FullName)), ToConsole); } ModuleAssemblies = asm.ToArray(); asm.AddRange(ScriptCompiler.Assemblies); asm.Prune(); ScriptCompiler.Assemblies = asm.FreeToArray(true); }, ToConsole); }
private static void CompileModules() { if (Compiled) { return; } ToConsole("Compiling Modules..."); TryCatch( () => { var files = ModulesDirectory.GetFiles("*.vnc.mod.dll", SearchOption.AllDirectories); var asm = new List <Assembly>(files.Length); foreach (FileInfo file in files) { TryCatch( () => { Assembly a = Assembly.LoadFrom(file.FullName); if (a != null && !asm.Contains(a)) { asm.Add(a); } }, ToConsole); } ModuleAssemblies = asm.ToArray(); asm.AddRange(ScriptCompiler.Assemblies); ScriptCompiler.Assemblies = asm.ToArray(); }, ToConsole); }