Programmatically compile projects via msbuild

Unanswered Programmatically compile projects via msbuild

  • Friday, April 13, 2012 11:15 AM
     
      Has Code

    Hello, I'm trying to compile a solution programmatically using Microsoft.Build.Execution.BuildManager class, the build process works well, i only want to know if there is a way to get the warnings and errors that the compilation may produce (the same errors and warnings that are printed out in the msbuild log file) because i didn't find nothing usefull in the BuildResult object.

    The code i use for compilation looks like following:

    BuildResult buildResult = BuildManager.DefaultBuildManager.Build(parameters, BuidlRequest);

    I've searched everywhere but with no luck, any help is greatly appreciated.

    Best regards Max.

All Replies

  • Sunday, April 15, 2012 7:29 AM
     
     
    MSBuild.exe in your .NET installation folder contains all the secrets. Simply analyze it using a decompiler (ILSpy, DotPeek or JustDecompile) you can see what Microsoft does to utilize the APIs.

    Lex Li (http://lextm.com)