Beispiel #1
0
        /// <summary>
        /// Runs the assembly with the specified arguments.xit
        /// </summary>
        /// <param name="workingDirectory">The working directory.</param>
        /// <param name="environmentVariables">The environment variables.</param>
        /// <param name="args">The main arguments.</param>
        /// <param name="logger">The logger.</param>
        /// <returns>System.Int32.</returns>
        public int Run(string workingDirectory, Dictionary <string, string> environmentVariables, string[] args, IServerLogger logger)
        {
            lock (disposingLock)
            {
                if (isDisposed)
                {
                    logger.OnLog("Error, server is being shutdown, cannot run Compiler", ConsoleColor.Red);
                    return(1);
                }
            }


            AppDomainShadow shadowDomain = null;

            try
            {
                shadowDomain = GetOrNew(IsCachingAppDomain);
                return(shadowDomain.Run(workingDirectory, environmentVariables, args, logger));
            }
            finally
            {
                if (shadowDomain != null)
                {
                    shadowDomain.EndRun();
                    if (!IsCachingAppDomain)
                    {
                        shadowDomain.Dispose();
                    }
                }
            }
        }
        /// <summary>
        /// Runs the assembly with the specified arguments.xit
        /// </summary>
        /// <param name="args">The main arguments.</param>
        /// <param name="logger">The logger.</param>
        /// <returns>System.Int32.</returns>
        public int Run(string[] args, IServerLogger logger)
        {
            AppDomainShadow shadowDomain = null;

            try
            {
                shadowDomain = GetOrNew(IsCachingAppDomain);
                return(shadowDomain.Run(args, logger));
            }
            finally
            {
                if (shadowDomain != null)
                {
                    shadowDomain.EndRun();
                    if (!IsCachingAppDomain)
                    {
                        shadowDomain.Dispose();
                    }
                }
            }
        }