Пример #1
0
        /// <summary>
        /// Invoke the C# compiler with the given arguments and current directory, and send output and error
        /// to the given TextWriters.
        /// </summary>
        private int CSharpCompile(
            string currentDirectory,
            string libDirectory,
            string responseFileDirectory,
            string tempPath,
            string[] commandLineArguments,
            TextWriter output,
            CancellationToken cancellationToken,
            out bool utf8output)
        {
            CompilerServerLogger.Log("CurrentDirectory = '{0}'", currentDirectory);
            CompilerServerLogger.Log("LIB = '{0}'", libDirectory);
            for (int i = 0; i < commandLineArguments.Length; ++i)
            {
                CompilerServerLogger.Log("Argument[{0}] = '{1}'", i, commandLineArguments[i]);
            }

            return(CSharpCompilerServer.RunCompiler(
                       responseFileDirectory,
                       commandLineArguments,
                       currentDirectory,
                       libDirectory,
                       tempPath,
                       output,
                       cancellationToken,
                       out utf8output));
        }
        /// <summary>
        /// Invoke the C# compiler with the given arguments and current directory, and send output and error
        /// to the given TextWriters.
        /// </summary>
        private BuildResponse CSharpCompile(
            string currentDirectory,
            string libDirectory,
            string responseFileDirectory,
            string[] commandLineArguments,
            CancellationToken cancellationToken)
        {
            CompilerServerLogger.Log("CurrentDirectory = '{0}'", currentDirectory);
            CompilerServerLogger.Log("LIB = '{0}'", libDirectory);
            for (int i = 0; i < commandLineArguments.Length; ++i)
            {
                CompilerServerLogger.Log("Argument[{0}] = '{1}'", i, commandLineArguments[i]);
            }

            return(CSharpCompilerServer.RunCompiler(
                       responseFileDirectory,
                       commandLineArguments,
                       currentDirectory,
                       RuntimeEnvironment.GetRuntimeDirectory(),
                       libDirectory,
                       AnalyzerLoader,
                       cancellationToken));
        }