|
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;
namespace WebLibraryMaker
{
public static class AspnetCompiler
{
public static int PrecompileWebApplication(Pathes pathes, bool debug)
{
string debugOption = "";
if (debug) debugOption = "-d ";
Process process = new Process();
process.StartInfo.FileName = Path.Combine(pathes.DotNetDirectory, "aspnet_compiler.exe");
process.StartInfo.Arguments = String.Concat(debugOption, "-f \"", pathes.TemporaryDirectory, "\" -v \"", pathes.ProjectName, "\" -p \"", pathes.ProjectDirectory, "\"");
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.UseShellExecute = false;
process.Start();
Console.Write(process.StandardOutput.ReadToEnd());
Console.Error.Write(process.StandardError.ReadToEnd());
process.WaitForExit();
if (process.ExitCode != 0) return process.ExitCode;
Directory.SetCurrentDirectory(pathes.CompiledDirectory);
return 0;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.