首页 > 解决方案 > 支持:无法从 DevOps 正确部署到 IIS

问题描述

我正在尝试构建、发布和部署到 IIS。我有几个问题。主要问题是它以我不熟悉的格式部署到我的 IIS 服务器。我在下面附上了截图。

我真正想要在那个目录中的是EazeeApp.UI.zip\Content\d_C\a\1\s\Source\EazeeApp.UI\obj\Release\Package\PackageTmp

如果我将该文件复制到我的网站文件夹的根目录中,viola.

这是我的构建配置:

trigger:
- master

pool:
  vmImage: 'windows-latest'

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

steps:
- task: NuGetToolInstaller@0

- 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: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

这是我的IIS Web App Deploy设置

#Your build pipeline references an undefined variable named ‘Parameters.WebsiteName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972

steps:
- task: IISWebAppDeploymentOnMachineGroup@0
  displayName: 'IIS Web App Deploy'
  inputs:
    WebSiteName: '$(Parameters.WebsiteName)'
    Package: '_EazeeApp\drop'
    XmlVariableSubstitution: True

在此处输入图像描述

标签: asp.net-mvcazure-devops

解决方案


Package: '_EazeeApp\drop'

您当前将其指向该文件夹,但它应该指向您要部署到目标站点的 Web 发布包

Package: '_EazeeApp\drop\EazeeApp.UI.zip'

推荐阅读