public string Compile(string solution_name, string logfile) { b = new BasicFileLogger(); b.Parameters = logfile; b.register(); Microsoft.Build.BuildEngine.Engine.GlobalEngine.BuildEnabled = true; Project p = new Project(Microsoft.Build.BuildEngine.Engine.GlobalEngine); p.BuildEnabled = true; p.Load(solution_name); p.Build(); string output = b.getLogoutput(); output += “nt” + b.Warningcount + ” Warnings.“; output += “nt” + b.Errorcount + ” Errors.“; b.Shutdown(); return(output); }
public CompilerBuilder(DocSuiteWeb.Common.Loggers.ILogger logger, string compilerLoggerPath, string projectFilePath, string binFolder) { try { _logger = logger; DirectoryInfo dirToLog = new DirectoryInfo(new DirectoryInfo(compilerLoggerPath).Parent.FullName); if (!dirToLog.Exists) { dirToLog.Create(); } _builderLogger = new BasicFileLogger() { Verbosity = LoggerVerbosity.Normal, Parameters = compilerLoggerPath }; _projectFilePath = projectFilePath; _binFolder = binFolder; } catch (Exception ex) { _logger.WriteError(ex, LogCategories); throw ex; } }