Azure DevOps - VSBuild for a specific project with publish not working

I have a solution that has around 63 odd projects however my primary target is around 6 projects. out of which 3 are DotNet Core APIs and 3 Web applications. I was able to publish my DotNet Core APIs using the DotNetCoreCLI@2 task. Unfortunately, when I try to publish my Web Application, I am facing the following error:

Error message

MSBUILD : error MSB1006: Property is not valid. Switch: OutputPath:**\WebApplicationMain\Publish


- task: VSBuild@1
    solution: '**\WebApplicationMain\MainWebApplication.csproj'
    msbuildArgs: '/t:build /p:DeployOnBuild=true /p:PublishProfile=publish.pubxml /p:OutputPath:"**\WebApplicationMain\Publish"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

here's my publish.pubxml

<Project ToolsVersion="4.0" xmlns="">
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />

What am I missing here? Any Suggestions?

1 answer

  • answered 2020-09-14 08:18 Shayki Abramczyk

    You use : in the /p:OutputPath: instead of =, so just fix it to: