我想构建一个 VS2008 项目(ASP.NET Web 应用程序),然后使用 Microsoft.Build.Engine 发布。
到目前为止,我已经成功地构建了这个项目。
但我无法将其发布到指定目录。
我的构建方法是:
private void BuildProject()
{
Engine engine = new Engine();
FileLogger logger = new FileLogger();
logger.Parameters = @"logfile=C:\temp\build.log";
engine.RegisterLogger(logger);
BuildPropertyGroup bpg = new BuildPropertyGroup();
bpg.SetProperty("Configuration", "Debug");
bpg.SetProperty("Platform", "AnyCPU");
bool success = engine.BuildProjectFile(GetProjectFileName(), null, bpg);
if (success)
Console.WriteLine("Success!");
else
Console.WriteLine("Build failed - look at c:\temp\build.log for details");
engine.UnloadAllProjects();
engine.UnregisterAllLoggers();
}
我的发布方法是:
private void PublishProject()
{
//no idea what goes here ... please help !!!
}
有任何想法吗 ???