How do you get KUDU to use MSBuild 15

后端 未结 3 1153
不知归路
不知归路 2021-01-13 08:50
Microsoft.Net.Compilers is only supported on MSBuild v15.0 and above

whatever the auto detect tooling is for KUDU, it always selects 14

is

3条回答
  •  执念已碎
    2021-01-13 09:17

    msbuild 15 is not used by default. You can use it, with a little modification to your Kudu script.

    Here is an example using msbuild 15 for restore, build and publish*.

    :: 1. Restore nuget packages
    call :ExecuteCmd nuget.exe restore "%DEPLOYMENT_SOURCE%\BACON.sln" -MSBuildPath "%MSBUILD_15_DIR%"
    IF !ERRORLEVEL! NEQ 0 goto error
    
    :: 2. Build and publish
    call :ExecuteCmd "%MSBUILD_15_DIR%\MSBuild.exe" "%DEPLOYMENT_SOURCE%\BACON.WEB.csproj" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS%
    IF !ERRORLEVEL! NEQ 0 goto error
    

    * change BACON.sln & BACON.WEB.csproj to your project file names

提交回复
热议问题