Here is my version of an C# asynchronous build tool. Utilizing MSBuild. MBuild has been recently open sourced and is available on Microsoft's github here. You you can clone my build tool on my bitbucket here. You can build this tool with Visual Studio 2013 Community or higher and .NET 4.5.
using System;
using System.Threading;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Build.Evaluation;
using Microsoft.Build.Exceptions;
namespace MyBuild
{
class Program
{
static void Main(string[] args)
{
Task t = MyBuildAsync(args);
t.Wait();
}
public async static Task<string> MyBuildAsync(string[] valParameter)
{
if (valParameter.Length == 1)
{
try
{
Project prj = new Project(valParameter[0]);
prj.Build();
await Task.Delay(100);
Thread.Sleep(1000);
}
catch (InvalidProjectFileException e)
{
Console.WriteLine("Project file was invaild" + e.Message);
}
}
else if (valParameter.Length == 0)
{
Console.WriteLine("Project file was not found");
}
return "project built";
}
}
}