Azure Devops Build Pipeline - files are not published

1.2k Views Asked by At

I'm trying to publish my application using a VS publish profile. When I publish through Visual Studio it works successfully, but through DevOps the publish does not work. The build is successful in both. Here is my VSBuild task definition:

      inputs:
        solution: '$(solution)'
        msbuildArgs: '/t:Restore /p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishBaseUrl=$(build.artifactstagingdirectory)'
        platform: '$(buildPlatform)'
        configuration: '$(buildConfiguration)'
2

There are 2 best solutions below

0
On

Try to use /p:publishUrl instead of /p:PublishBaseUrl. If it still doesn't work, share your pubxml file and DevOps build log.

0
On

You are using publish profile, so you could specify the MSBuild argument like this: /p:DeployOnBuild=true /p:PublishProfile=myprofile

Related thread: Using msbuild to execute a File System Publish Profile