title: How to use publish profile options from Visual Studio in azure pipelines?
body: <p>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:</p>
  
  <pre><code>  &lt;PropertyGroup&gt;
      &lt;WebPublishMethod&gt;FileSystem&lt;/WebPublishMethod&gt;
      &lt;PublishProvider&gt;FileSystem&lt;/PublishProvider&gt;
      &lt;LastUsedBuildConfiguration&gt;Release&lt;/LastUsedBuildConfiguration&gt;
      &lt;LastUsedPlatform&gt;Any CPU&lt;/LastUsedPlatform&gt;
      &lt;SiteUrlToLaunchAfterPublish /&gt;
      &lt;LaunchSiteAfterPublish&gt;True&lt;/LaunchSiteAfterPublish&gt;
      &lt;ExcludeApp_Data&gt;True&lt;/ExcludeApp_Data&gt;
      &lt;publishUrl&gt;C:\Test&lt;/publishUrl&gt;
      &lt;DeleteExistingFiles&gt;True&lt;/DeleteExistingFiles&gt;
      &lt;PrecompileBeforePublish&gt;True&lt;/PrecompileBeforePublish&gt;
      &lt;EnableUpdateable&gt;False&lt;/EnableUpdateable&gt;
      &lt;DebugSymbols&gt;False&lt;/DebugSymbols&gt;
      &lt;WDPMergeOption&gt;MergeEachIndividualFolder&lt;/WDPMergeOption&gt;
      &lt;UseMerge&gt;True&lt;/UseMerge&gt;
    &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>The main thing that I want to achieve, is implementing <code>&lt;WDPMergeOption&gt;MergeEachIndividualFolder&lt;/WDPMergeOption&gt;</code> when deploying using build and release pipeline. </p>
  
  <ul>
  <li><p>For release pipeline, I am using IIS Web Deployment.</p></li>
  <li><p>For build pipeline agent sepcification, I am using vs2017-win2016</p></li>
  <li><p>For build solution task, I am using latest version of visual stidio</p></li>
  </ul>
  
  <p>Things I've tried:</p>
  
  <p><strong>1. Passing configuration arguments to msbuild, for Build Solution task in azure build pipeline:</strong></p>
  
  <pre><code>/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\\"
  </code></pre>
  
  <p><strong>2. Uploading FolderProfile.pubxml , and passing arguments to msbuild to read from that file</strong></p>
  
  <p>It all builds and releases fine, but doesn't merge assemblies in release, as configured with merge options, it seems like <code>msbuild</code> ignores these additional merge arguments.</p>
  
  <p>How can this be done, the main question is how can I use <code>MergeEachIndividualFolder</code> option when deploying with azure pipeline?</p>
  
  <p>I've also searched a lot, but non of the questions seems to cover the solution.</p>
  
  <p><a href="https://stackoverflow.com/questions/53931787/azure-devops-build-publish-doesnt-create-compiled-files-in-bin-folder-on-pub">Azure DevOps Build - publish doesn't create .compiled files in bin folder on publish</a></p>
  
  <p><a href="https://github.com/Microsoft/msbuild/issues/1901" rel="nofollow noreferrer">MSBuild commandline seems to ignore publish properties</a></p>