I am working with a classic Azure build pipeline which is using the following MsBuild arguments for creating a package and zipping it:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\"
The above arguments are creating an artifact but with too many nested folders. To avoid that I used this argument: based on this SO question: Avoid nested folders in zipped artifact
/p:OutDir="$(build.artifactstagingdirectory)"
which fixed my one problem but now creating another. The build solution task does not create the bin/release folder for some of the projects inside the solution and for that reason some of the copy tasks are failing.
Copy task failing due to missing bin/release
Copy task working for another project in the solution because bin/release folder exists for it
Nuget task is also failing due to missing bin/release folder
Is there any possibility to not miss the bin/release folders when passing /p:OutDir="$(build.artifactstagingdirectory) argument for avoiding nested folders structure for zipped artifact