【问题标题】:How to specify destination path on azure release?如何在 azure 版本上指定目标路径?
【发布时间】:2021-02-24 19:58:22
【问题描述】:

我正在尝试配置一个发布管道,以便将我的 asp.net 框架 4.5.2 Web 应用程序部署到虚拟机。 这是我的管道 .yml 文件:

# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: PublishBuildArtifacts@1

问题是发布已成功执行,但我的网站没有看到任何变化。当我开始用谷歌搜索时,我发现很多人因为缓存问题而面临这个问题(建议:使用隐身模式,清除缓存等) 但后来我查看了发布日志,发现部署转到 wwwroot/inetpub 中的默认网站文件夹,但我的网站已经托管在 IIS 上并获得了不同的位置。所以我想我应该改变目标路径。任何人都可以帮助我吗?提前致谢。

【问题讨论】:

    标签: asp.net iis azure-devops azure-devops-pipelines


    【解决方案1】:
    1. 我注意到您指定了/p:PackageLocation="$(build.artifactStagingDirectory),您需要仔细检查包裹是否在build.artifactStagingDirectory 中。我没有看到您有将工件复制到该位置的任务。

    2. 检查您是否可以使用IIS Web App Deployment Using WinRM 来部署您的网络应用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多