I am writing a console application to get a solution from tfs server, create it and publish it on iis, but I'm stuck in creating ...
I found this code that works like a charm
public static void BuildProject()
{
string solutionPath = Path.Combine(@"C:\MySolution\Common\Common.csproj");
List<ILogger> loggers = new List<ILogger>();
loggers.Add(new ConsoleLogger());
var projectCollection = new ProjectCollection();
projectCollection.RegisterLoggers(loggers);
var project = projectCollection.LoadProject(solutionPath);
try
{
project.Build();
}
finally
{
projectCollection.UnregisterAllLoggers();
}
}
but my solution is quite large and contains several projects that depend on each other (for example, project A has a link to project B)
How to get the right order to create each project? is there a way to build a complete solution from a .sln file?
source
share