/// <summary>
/// Loads configuration from Machine.config, phpc.exe.config, from files specified by command line arguments,
/// and from command line arguments themselves.
/// </summary>
/// <exception cref="ConfigurationErrorsException">An error occured while loading the configuration.</exception>
public static CompilerConfiguration/*!*/ LoadConfiguration(
ApplicationContext/*!*/ appContext, List<FullPath>/*!*/ paths, TextWriter output)
{
Configuration.IsBuildTime = true;
Configuration.Reload(appContext, true);
// Machine.config, phpc.exe.config:
CompilerConfiguration result = new CompilerConfiguration(Configuration.Application);
// explicitly specified or default configs:
foreach (FullPath path in paths)
{
if (output != null) output.WriteLine(path);
result.LoadFromFile(appContext, path);
}
// load libraries lazily
result.LoadLibraries(appContext);
//
return result;
}