Beispiel #1
0
        private static void CompileServices()
        {
            if (Compiled)
            {
                return;
            }

            ToConsole("Compiling Services...");

            TryCatch(
                () =>
            {
                var files = ServicesDirectory.GetFiles("*.dll", SearchOption.AllDirectories);
                var asm   = new List <Assembly>(files.Length);

                foreach (var file in files)
                {
                    TryCatch(() => asm.Update(Assembly.LoadFrom(file.FullName)), ToConsole);
                }

                ServiceAssemblies = asm.ToArray();

                asm.AddRange(ScriptCompiler.Assemblies);
                asm.Prune();

                ScriptCompiler.Assemblies = asm.FreeToArray(true);
            },
                ToConsole);
        }
        private static void CompileServices()
        {
            if (Compiled)
            {
                return;
            }

            ToConsole("Compiling Services...");

            TryCatch(
                () =>
            {
                var files = ServicesDirectory.GetFiles("*.vnc.srv.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);
                }

                ServiceAssemblies = asm.ToArray();
                asm.AddRange(ScriptCompiler.Assemblies);
                ScriptCompiler.Assemblies = asm.ToArray();
            },
                ToConsole);
        }