错误 ASPCONFIG:无法加载文件或程序集 'CrystalDecisions.CrystalReports.Engine,版本 = 13.0.2000.0 Azure DevOps CI 管道

时间:2021-02-25 07:59:57

标签: azure azure-devops azure-pipelines-yaml

我是 Azure DevOps 的新手,我正在尝试将开发环境迁移到 Azure 开发并构建 CI 管道,如下所示:

# 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)'

这是 Azure 平台建议的默认管道脚本。

这是发送到电子邮件的错误:

4 error(s), 8 warning(s)
    EServices\web.config(68,0): Error ASPCONFIG: Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
    Process 'msbuild.exe' exited with code '1'.
    ASPNETCOMPILER(0,0): Error 1003: The directory 'D:\a\1\s\ulsa_1\' doesn't exist.
    Process 'msbuild.exe' exited with code '1'.

Azure DevOps pipeline build error

我使用的是 Visual Studio 2017 社区版 Telerik 2019 年第三季度 水晶报表 13.0.2000

1 个答案:

答案 0 :(得分:0)

出现此问题的原因是 Microsoft 托管的代理中未安装 Crystal Report。您可以参考 this document 了解有关安装在 Microsoft 托管代理中的软件的信息。

要解决这个问题,您可以:

  1. 使用自托管代理。这个方法比较简单,你可以用一台安装了水晶报表的机器作为代理来运行你的管道。单击 this document 了解有关如何设置自托管代理的详细信息。

  2. 手动将与 Crystal Report 相关的 dll 添加到您的存储库。在此方法中,您需要在存储库中创建一个新文件夹并在其中添加 CrystalDecisions.CrystalReports.Engine dll。然后,您需要编辑 Reference 以将路径更改为 dll 存储库中的相对路径。