I would like to compile a solution by passing the solution file path (.sln file) and the build mode (debug, release).
I do not want to call a command line process like devenv.exe or msbuild.exe. Instead I would like to use an API and know if there were compile errors.
Is it possible?
Please provide samples if you think you know how to do that.
You're going to have to launch a process at some point to do the compilation, so you might as well spawn a process to kick off the compilation. It is going to be much easier than struggling with an API.
Andrew gives some good advice about how you might go about it, but I still think it is a mistake.