none
Azure DevOps Pipeline project not compiling using references to a Nuget package RRS feed

  • Question

  • I have a solution with a project that has a package reference to Newtonsoft as follows:

        <PackageReference Include="Newtonsoft.Json">
          <Version>12.0.3</Version>
        </PackageReference>

    It compiles fine on my computer but when I run the azure pipeline, I get the following:

    ##[error]Utils\JsonExtensions.cs(7,7): Error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)

    The following is the contents of my azure-pipelines.yml:

    # .NET Desktop
    # Build and run tests for .NET Desktop or Windows classic desktop solutions.
    # Add steps that publish symbols, save build artifacts, and more:
    # https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

    trigger:
    - master

    pool:
      vmImage: 'windows-latest'

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

    steps:

    - task: NuGetToolInstaller@1

    - task: NuGetCommand@2
      inputs:
        command: 'restore'
        feedsToUse: select
        restoreSolution: '$(solution)'

    - task: VSBuild@1
      inputs:
        solution: '$(solution)'
        platform: '$(buildPlatform)'
        configuration: '$(buildConfiguration)'

    - task: VSTest@2
      inputs:
        platform: '$(buildPlatform)'
        configuration: '$(buildConfiguration)'
    Sunday, December 15, 2019 3:53 AM

Answers

All replies