title: Azure DevOps Build Task: create a zip with contents identical to Visual Studio Publish
body: <p>In Visual Studio, when we publish to a folder, that folder contains exactly what we need to deploy.</p>
  
  <p>In Azure Pipeline, the Build Solution task produces a a bunch of (to us) unnecessary files plus a zip file (nice!).  The zip contains the files we need, but buried in an crazy deep folder path:</p>
  
  <pre><code>\Content\D_C\a\1\s\src\MyProject\obj\Release\Package\PackageTmp\our-files.dll
  </code></pre>
  
  <p>What we would prefer is:</p>
  
  <pre><code>\our-files.dll
  </code></pre>
  
  <p>It also modifies connectionStrings in the web.config to support the deploy script it ships with.  We don't need that script and that modification is a pain (which we disabled by adding<code>&lt;AutoParameterizationWebConfigConnectionStrings&gt;false&lt;/...&gt;</code> to the .csproj file - yuck!)` .</p>
  
  <p>We tried fussing with the parameters in the Build Solution step:</p>
  
  <pre><code>/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"
  </code></pre>
  
  <ul>
  <li><p>Changing <code>DeployOnBuild</code> to <code>false</code> caused the $(build.artifactsstagingdirectory) to be empty (causing the next step to deploy nothing)</p></li>
  <li><p>Changing <code>WebPublishMethod</code> to <code>FileSystem</code> made no difference (try finding documentation on the allowed values!)</p></li>
  <li><p>Changing <code>PackageAsSingleFile</code> to <code>false</code> did what one would expect - no zip, but the contents were still buried in that deep folder structure.</p></li>
  </ul>
  
  <p>Our downstream script <em>could</em> open the manifest file, xpath out the deep path baked into the zip (does the path always start with <code>d_C</code>?), unzip and grab the contents from there - but what a pain and how unnecessary.</p>
  
  <p>Is there a way to publish just a nice clean build - a zip with contents that directly unpacks to the same files as a plain-jane Publish from Visual Studio does?</p>