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
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.