Esempio n. 1
0
        internal static int Run(string[] args)
        {

            CompilerFatalError.Handler = FailFast.OnFatalException;

            Csc compiler = new Csc(CSharpResponseFileName, Directory.GetCurrentDirectory(), args);

            // We store original encoding and restore it later to revert 
            // the changes that might be done by /utf8output options
            // NOTE: original encoding may not be restored if process terminated 
            Encoding origEncoding = Console.OutputEncoding;
            try
            {
                if (compiler.Arguments.Utf8Output && Console.IsOutputRedirected)
                {
                    Console.OutputEncoding = Encoding.UTF8;
                }
                return compiler.Run(Console.Out);
            }
            finally
            {
                try
                {
                    Console.OutputEncoding = origEncoding;
                }
                catch
                { // Try to reset the output encoding, ignore if we can't
                }
            }

        }
Esempio n. 2
0
 static int Main(string[] args)
 {
     return(Csc.Run(args));
 }