i've encounter the same issue, after i upgrade from vs 2019 to vs2022。MSbuild is 17.0。
And on my Jenkins CI,I need to change the command about Version to " 17.0 ^ "。
If I remain as "16.0^",It will not generate the _publishedWebsites folder for me.
EX:
bat returnStdout: true, script: '''c:
cd C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin
msbuild "D:\JenkinsWorkSpaces\*****\****.csproj" /p:VisualStudioVersion=17.0 ^
/p:Configuration=Release ^
/p:Platform=AnyCPU ^
/p:DeployOnBuild=true ^
/p:OutputPath="D:\Release\****" ^
/p:DeleteExistingFiles=True /t:Clean,Build'''