System.CodeDom.Compiler.CodeCompiler.Compile C# (CSharp) Method

Compile() private method

private Compile ( CompilerParameters options, string compilerDirectory, string compilerExe, string arguments, string &outputFile, int &nativeReturnValue, string trueArgs ) : void
options CompilerParameters
compilerDirectory string
compilerExe string
arguments string
outputFile string
nativeReturnValue int
trueArgs string
return void
        internal void Compile(CompilerParameters options, string compilerDirectory, string compilerExe, string arguments, ref string outputFile, ref int nativeReturnValue, string trueArgs) {
            string errorFile = null;
            outputFile = options.TempFiles.AddExtension("out");
            
            // We try to execute the compiler with a full path name.
            string fullname = compilerDirectory + compilerExe;
            if (File.Exists(fullname)) {
                string trueCmdLine = null;
                if (trueArgs != null)
                    trueCmdLine = "\"" + fullname + "\" " + trueArgs;
                nativeReturnValue = Executor.ExecWaitWithCapture(options.SafeUserToken, "\"" + fullname + "\" " + arguments, Environment.CurrentDirectory, options.TempFiles, ref outputFile, ref errorFile, trueCmdLine);
            }
            else {
                throw new InvalidOperationException(SR.GetString(SR.CompilerNotFound, fullname));
            }
        }