0

I am new to Azure DevOps, I am trying to move the development environment to Azure develops and build the CI pipeline as follows:

# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://learn.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)'

This the default pipeline script suggested by the Azure platform.

This is the error sent to the email :

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

I am using visual studio 2017 community edition Telerik 2019 Q3 Crystal Reports 13.0.2000

Mai
  • 121
  • 1
  • 10

1 Answers1

1

The reason for this question is that the Crystal Report is not installed in the Microsoft-hosted agent. You can refer to this document for information about softwares installed in the Microsoft-hosted agent.

To solve this question, you can:

  1. Use self-hosted agent. This method is relatively simple, you can use a machine with Crystal Report installed as an agent to run your pipelines. Click this document for detailed information about how to set a self-hosted agent.

  2. Add Crystal Report related dlls to your repository manually. In this method, you need to create a new folder in your repository and add CrystalDecisions.CrystalReports.Engine dll in it. Then, you need to edit the Reference to change the path to the relative path in the repository of the dll.

Jane Ma-MSFT
  • 4,461
  • 1
  • 6
  • 12
  • I have a similar issue; in that I'm getting the same error. I tried adding NuGet packages for CrystalDecisions.Shared and CrystalDecisions.CrystalReports.Engine, but they didn't work. In my case I'm using TFS 2015 on-prem. How do I get those 2 packages onto our TFS Build server? – Rod Aug 31 '21 at 22:01