Azure管道YAML -安装项目nuget包



我有一个包含大约100个aps.net项目的解决方案,其中一个是Selenium测试套件。我希望创建一个Azure管道,它只安装Selenium项目的Nuget包,然后构建并运行Selenium测试。当运行VSBUILD步骤时,我的管道失败了,声称项目NuGet包丢失了,所以看起来我没有正确地获得项目包。我有以下YAML:

    trigger:
    - master
    
    schedules:
      - cron: "0 22 * * *"
        displayName: Daily midnight run
        branches:
          include:
          - feature/*
          - release/*
        always: true
    
    pool:
      vmImage: 'windows-latest'
    
    variables:
      solution: '**/*.sln'
      buildPlatform: 'Any CPU'
      buildConfiguration: 'Release'
    
    steps:
    - task: NuGetToolInstaller@1
   
    - task: DotNetCoreCLI@2
      displayName: dotnet restore
      inputs:
        command: restore
        projects: '**/**/Nykredit.Feature.Selenium/Nykredit.Feature.Selenium.Test.csproj'
        includeNuGetOrg: true
    
    - task: VSBuild@1
      displayName: 'Build Selenium Tests'
      inputs:
        solution: '**/**/Nykredit.Feature.Selenium/Nykredit.Feature.Selenium.Test.csproj'
        vsVersion: 16.0
        # platform: '$(BuildPlatform)'
        # configuration: '$(BuildConfiguration)'
    
    
    - task: DotNetCoreCLI@2
      inputs:
        command: test
        projects: '**/*/*.csproj'
        arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
    
    - task: VSTest@2
      inputs:
        platform: '$(buildPlatform)'
        configuration: '$(buildConfiguration)'

我得到以下错误:

##[error]srcFeatureNykredit.Feature.SeleniumNykredit.Feature.Selenium.Test.csproj(73,5): Error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ......packagesMSTest.TestAdapter.1.2.0buildnet45MSTest.TestAdapter.props.

关于如何安装Nykredit.Feature.Selenium.Test.csproj包的任何建议只有吗?

虽然我无法找到导致错误的原因,但解决方案最终是卸载并重新安装有问题的软件包。据推测,这纠正了配置中版本之间的一些差异。

相关内容

  • 没有找到相关文章