I have an ASP.NET project and I want to implement CI-CD using Azure pipelines, to deploy to custom server (IIS). Currently, when using Visual Studio(2019) to publish web application manually, I am using these options for publish profile:
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<publishUrl>C:\Test</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>False</EnableUpdateable>
<DebugSymbols>False</DebugSymbols>
<WDPMergeOption>MergeEachIndividualFolder</WDPMergeOption>
<UseMerge>True</UseMerge>
</PropertyGroup>
The main thing that I want to achieve, is implementing <WDPMergeOption>MergeEachIndividualFolder</WDPMergeOption> when deploying using build and release pipeline.
For release pipeline, I am using IIS Web Deployment.
For build pipeline agent sepcification, I am using vs2017-win2016
For build solution task, I am using latest version of visual stidio
Things I've tried:
1. Passing configuration arguments to msbuild, for Build Solution task in azure build pipeline:
/p:PackageAsSingleFile=true /p:PackageLocation="$(build.artifactstagingdirectory) /p:OutputPath=bin
/p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:PrecompileBeforePublish=true
/p:EnableUpdateable=false /p:DebugSymbols=true /p:UseMerge=true /p:DeleteAppCodeCompiledFiles=True
/p:DeleteExistingFiles=True /p:WDPMergeOption=MergeEachIndividualFolder /p:UseFixedNames=true\\"
2. Uploading FolderProfile.pubxml , and passing arguments to msbuild to read from that file
It all builds and releases fine, but doesn't merge assemblies in release, as configured with merge options, it seems like msbuild ignores these additional merge arguments.
How can this be done, the main question is how can I use MergeEachIndividualFolder option when deploying with azure pipeline?
I've also searched a lot, but non of the questions seems to cover the solution.
Azure DevOps Build - publish doesn't create .compiled files in bin folder on publish