Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

azure - dotnet test case does not obey solution build order

I have a YAML pipeline which doesnt always obey the project build order

 - job: Job_1
    displayName: Agent job 1
    pool:
      vmImage: windows-2019
    steps:
    - task: UseDotNet@2
      displayName: '.NET Core 3.1.404'
      inputs:
        version: '3.1.404'
        packageType: sdk
    - task: DotNetCoreCLI@2
      enabled: true
      displayName: dotnet test
      continueOnError: falsefo
      inputs:
        command: test
        projects: '**/*test/*.csproj'
        arguments: --configuration $(buildConfiguration) 
        publishTestResults: true          

This means that for some executions of the pipeline I get the error

Unable to find package NETStandard.Library with version (>= 2.0.3)

This occurs on a project that is not first to build in Visual Studio

Is there anyway of enforcing the build order? Or getting this package?

Paul


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Unable to find package NETStandard.Library with version (>= 2.0.3). Is there anyway of enforcing the build order? Or getting this package?

The problem is that the NETStandard.Library package was not found. I think it has nothing to do with the build order of the projects. NETStandard.Library is a nuget package, you can try to add a nuget restore task to the pipeline.

- task: NuGetCommand@2
  inputs:
    command: 'restore'
    feedsToUse: 'config'
    nugetConfigPath: 'nuget.config'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...