How to run MSBuild from Powershell without spawning msbuild.exe process?

后端 未结 5 1197
旧时难觅i
旧时难觅i 2020-12-28 21:15

I am considering running MSBuild from a Powershell script by tapping directly to the MSBuild assemblies (as opposed to looking up MSBuild install path and starting msbuild.e

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-28 21:35

    I was looking for this same thing. Following JaredPar's lead I found the following:

    This is a how-to on making a cmdlet.

    http://bartdesmet.net/blogs/bart/archive/2008/02/03/easy-windows-powershell-cmdlet-development-and-debugging.aspx

    The MSBuild API is part of these namespaces:

    Microsoft.Build.Framework
    
    Microsoft.Build.BuildEngine
    

    And the MSBuild documentation can be found here (this is more for completeness than in response to your question):

    http://msdn.microsoft.com/en-us/library/wea2sca5.aspx

提交回复
热议问题