0
votes

I have a multi-project solution that includes WinForms app, ASP.Net WebApi2, ASP.NetCore projects. Currently I can't get the whole solution to build in a self-hosted agent. So I created a new pipeline and used MSBuild task to build just the WebApi2 project. I also change the Nuget version to match the one used on my local machine, which is 5.3.1.

This is the yaml for the build task:

steps:
- task: MSBuild@1
  displayName: 'Build project $/path/myproject.csproj'
  inputs:
    solution: '$/path/myproject.csproj'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    msbuildArguments: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
    logProjectEvents: true

The build succeeds but nothing is created. I get a warning:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(778,5): Warning : The OutputPath property is not set for project 'AboServer.API.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='release' Platform='any cpu'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

What do I need to set in the pipeline to create the artifcats?

1

1 Answers

0
votes

Can you try with AnyCpu instead of any cpu for platform parameter?