Home > Blockchain >  GitHub BuildPipeline for Dotnet Core on Linux fails without changes since last run; requests install
GitHub BuildPipeline for Dotnet Core on Linux fails without changes since last run; requests install

Time:11-21

I tried to add changes to my code and the build pipeline for Linux stopped working. The ones for Windows and Mac succeed.

I reverted all changes, so there are no changes except for comments since the last PullRequest which succeeded.

Now it fails with the following message: (Short: "You must install or update .NET to run this application.")

Build started 11/20/2022 12:32:08.
     1>Project "/home/runner/work/isoxml-dotnet/isoxml-dotnet/isoxml_dotnet.sln" on node 1 (VSTest target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Debug|Any CPU".
Test run for /home/runner/work/isoxml-dotnet/isoxml-dotnet/Dev4Agriculture.ISO11783.ISOXML.Test/bin/Debug/netcoreapp3.1/Dev4Agriculture.ISO11783.ISOXML.Test.dll (.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 17.3.1 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process for source(s) '/home/runner/work/isoxml-dotnet/isoxml-dotnet/Dev4Agriculture.ISO11783.ISOXML.Test/bin/Debug/netcoreapp3.1/Dev4Agriculture.ISO11783.ISOXML.Test.dll' exited with error: You must install or update .NET to run this application.
App: /home/runner/.nuget/packages/microsoft.testplatform.testhost/16.9.4/lib/netcoreapp2.1/testhost.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '3.1.0' (x64)
.NET location: /usr/share/dotnet/
The following frameworks were found:
  6.0.10 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=ubuntu.22.04-x64
. Please check the diagnostic logs for more information.

Test Run Aborted.
     1>Done Building Project "/home/runner/work/isoxml-dotnet/isoxml-dotnet/isoxml_dotnet.sln" (VSTest target(s)) -- FAILED.

Build FAILED.
    0 Warning(s)
    0 Error(s)

My Build Pipeline looks like this:

name: .NET

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  buildLinux:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        dotnet-version: ['3.0', '3.1.x', '5.0.x','6.0.x' ]

    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v2
    - name: Restore dependencies
      run: dotnet restore
    - name: Build Linux
      run: dotnet build --no-restore
    - name: Test
      run: dotnet test --no-build --verbosity normal
  buildWindows:

    runs-on: windows-latest
    strategy:
      matrix:
        dotnet-version: ['3.0', '3.1.x', '5.0.x','6.0.x' ]

    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v2
    - name: Restore dependencies
      run: dotnet restore
    - name: Build Windows
      run: dotnet build --no-restore
    - name: Test
      run: dotnet test --no-build --verbosity normal
  buildMac:

    runs-on: macos-latest
    strategy:
      matrix:
        dotnet-version: ['3.0', '3.1.x', '5.0.x','6.0.x' ]

    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v2
    - name: Restore dependencies
      run: dotnet restore
    - name: Build Mac
      run: dotnet build --no-restore
    - name: Test
      run: dotnet test --no-build --verbosity normal

You can review the PullRequest that started the Pipeline here: https://github.com/dev4Agriculture/isoxml-dotnet/pull/31

Please recognize that there are no changes in the dotnet.yml

What I tried so far:

  • Revert all changes; everything left is just comments
  • Change version of actions/setup-dotnet to v3, v3.0.2, v2.0.1

CodePudding user response:

I was able to make it running by changing the runs-on-Variable from ubuntu@latest to [email protected]. However, I don't really see this as a fix, more wondering what would need to be changed to have it run on ubuntu@latest

CodePudding user response:

Your Azure Pipelines YAML calls the setup-dotnet action, but won't actually pass it a version to. That will just select the default version on the OS image.

Make sure you pass your matrix variable:

- uses: actions/setup-dotnet@v3
  with:
    dotnet-version:  ${{ matrix.dotnet-version }}

My guess is they stripped a number of no longer supported dotnet SDKs from the image now that dotnet 7 has been released.

  • Related