I'm trying to set up a CI/CD enviroment, and decided to rely in c# as much as possible.
In order to do that, I created a console application that is going to be responsible from building several .Net projects.
One of those projects is a plain simple console application targeting .Net 6, but when building it, yields a couple of errors. The code from the builder project is this simple:
var projectFileName = @"..\..\..\..\ConsoleApp2\ConsoleApp2.csproj";
var pc = new ProjectCollection();
var GlobalProperty = new Dictionary<string, string>();
GlobalProperty.Add("Configuration", "Debug");
GlobalProperty.Add("Platform", "x86");
var BuidlRequest = new BuildRequestData(projectFileName, GlobalProperty, null, new string[] { "Build" }, null);
var buildResult = BuildManager.DefaultBuildManager.Build(new BuildParameters(pc), BuidlRequest);
I'm receiving the error:
Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found. Manifest file path 'C:\Users\myUser\source\BuilderProject\bin\Debug\net6.0\SdkResolvers\Microsoft.Build.NuGetSdkResolver\Microsoft.Build.NuGetSdkResolver.xml'. SDK resolver path: C:\Users\myUser\source\BuilderProject\bin\Debug\net6.0\Microsoft.Build.NuGetSdkResolver.dll C:\Users\myUser\source\repos\WpfApp1\ZConsoleApp2\ZConsoleApp2.csproj
Any clues in how to get rid of the error, on how to build a project from a .Net project? I have been flicking through many links but didn't find much information.
Thanks!