-1

I developed a new project and add it to an already existing solution. When I sent it to my Git repos the pipeline don't zip it and don't add it to the drop folder that I'm targeting so after in my release I can't deploy it to Azure because the file don't exist.

I'm using a task "Visual Studio Build" and this command for MSBuild Arguments in my pipeline :

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\drop\\" /p:AutoParameterizationWebConfigConnectionStrings=False

and with this I don't have any build errors.

For the "Solution" box I tell it to go and get the .sln because I have several projects in it which must be deployed. The new project is however well referenced in the .sln but nothing to do the pipeline does not build it.

Thanks for your help

1 Answers1

0

In such cases make sure we set the below parameter as false:

/p:PackageAsSingleFile=false 

Below is one of the samples:

- task: VSBuild
  displayName: ‘solution for build'
  inputs:
    solution: '$(Parameters.solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"   /t:Sample_WebApi:Rebuild'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'

To make sure that csproj is not missed, set the target to folder level instead of csproj file level.

Refer to one of the MS Docs to understand about builds and its relative information, and to understand about each build for Visual Studio Build task.

SaiKarri-MT
  • 1,174
  • 1
  • 3
  • 8