I want to Build a VS2008 project (ASP.NET Web Application) and then publish using Microsoft.Build.Engine.
I have so far successfully managed to BUild the project.
But i am unable to Publish it to a specified directory.
My build method is:
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();
}
And my publish method is:
private void PublishProject()
{
//no idea what goes here ... please help !!!
}
Any ideas ???