What do i need to specify for the root file/folder in publish task for MSBuild "Release"?
Is the .NET release basically the binaries? Because for AngularOutput build I had to specify path of the AngularOutput, but for .NET Release, I am not sure what path that would be, i would think its the entire project, which means...its the binaries?
expected artifact:
UPDATE: Resulting artifact following Kevin's YAML:
inside _PublishedWebsites
Following update3, when running on windows agent:
Update#4: Using VSBuild
steps:
- task: VSBuild@1
displayName: '.Net build | Build solution'
inputs:
solution: 'Project123/*.csproj'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: AnyCPU
configuration: Release
msbuildArchitecture: x64
Result is the same, placed in long path:
update#5: Using /p:PublishProfile=Project123.pubxml
MSBuild arg instead, and running on windows agent, the build completes just fine but this time i get this warning for Publish Task:
##[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'Release'.
I tried adding /p:OutputPath=$(build.artifactstagingdirectory)
to the MSBuild args alongside the publish profile arg, and the result is the same one i posted before:
Remark:
Actually do we even need /p:DeployOnBuild=true
? I understand that is to deploy, but I dont think we want or should deploy yet in the pipeline because we have a Release for that specifically to deploy the published artifacts to the App Service.
$(build.ArtifactStagingDirectory)/$(Build.BuildId).zip
->$(build.ArtifactStagingDirectory)
. However, no artifact was produced this time. got the following warning:##[warning]Directory '/home/vsts/work/1/a' is empty. Nothing will be added to build artifact 'Release'.
– Cataster/p:DeployOnBuild=true /p:PublishProfile=xxxx
to the build arg to use the publish profile. Please check if it could make some changes – Kevin Lu-MSFT