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

后端 未结 5 1196
旧时难觅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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-28 21:49

    I would very highly suggest looking at PSake.

    Let me quote a portion of that page:

    Remember that psake is syntactic sugar around PowerShell. So anything you can do in PowerShell, you can do in psake. That means that you can run MSBuild, NAnt, or other scripts. There is no need to completely replace your current build system. You can use psake to automate and extend it!

    psake automatically adds the appropriate version of .NET Framework to its path. So you can access MSBuild, csc.exe, vbc.exe, or any other tools installed in $env:windir\Microsoft.NET\Framework\$version\ without the fully qualified path.

提交回复
热议问题