Azure DevOps Build Task: create a zip with contents identical to Visual Studio Publish

前端 未结 1 1717
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 06:39

In Visual Studio, when we publish to a folder, that folder contains exactly what we need to deploy.

In Azure Pipeline, the Build Solution task produces a a bunch of

相关标签:
1条回答
  • 2021-01-13 06:56

    In the Visual Studio Build step change "MSBuild Arguments" to

    /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"    /p:UseWPP_CopyWebApplication=true  /p:OutDir="$(build.artifactstagingdirectory)"  
    

    The key thing is /p:OutDir="$(build.artifactstagingdirectory)" resolves the directory issue and /p:UseWPP_CopyWebApplication=true removes web.config.release and web.config.debug

    Then update Publish Build Artifacts step "Path to publish" to

    $(build.artifactstagingdirectory)\_PublishedWebsites
    
    0 讨论(0)
提交回复
热议问题