Jenkins: no tool named MSBuild found

前端 未结 5 1096
闹比i
闹比i 2021-02-02 02:25

Setting up a Pipeline build in Jenkins (Jenkins 2.6), copying the sample script for a git-based build gives: \"no tool named MSBuild found\". I have set MSBuild Tool in Ma

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-02 02:45

    We have to define msbuild which is installed in Global Tool Configuration in script block

    stage('App_Build'){
                    steps{
                        tool name: 'MsBuild', type: 'msbuild'
                        bat "\"${tool 'MsBuild'}\"My.Service.sln /t:Rebuild /p:Configuration=Release"
    }
    }
    

    This will work

提交回复
热议问题