GitVersion: Cannot Run with Only .NET 6 Installed

Describe the bug Attempting to run this in a project using GitHub actions with ONLY .NET 6 installed results in an error.

Expected Behavior

Expected support to work with .NET 6, without installing additional frameworks.

Actual Behavior

The following error is displayed

Run gittools/actions/gitversion/execute@v0.9.7
Command: dotnet-gitversion /home/runner/work/icg-website/icg-website /output json /output buildserver /config GitVersion.yml
/home/runner/.dotnet/tools/dotnet-gitversion /home/runner/work/icg-website/icg-website /output json /output buildserver /config GitVersion.yml
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
  - The following frameworks were found:
      6.0.0 at [/home/runner/.dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

Possible Fix

Installation of .NET 5 in addition to 6 works, but adds to build times etc.

Steps to Reproduce

Run the commend on a machine with only .NET 6 installed. As example, the following is the first part of our GitHub action that generated the above.

name: CI/CD

on:
  push:
    branches: [ develop ]
  pull_request:
    branches: [ develop ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: Build and Publish

    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: Ensure .NET Installed
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 6.0.x
        
    - name: Install EF Tools
      run: dotnet tool install --global dotnet-ef
    
    - name: Install GitVersion
      run: dotnet tool install --global GitVersion.Tool

    - name: Determine Version
      id: gitversion
      uses: gittools/actions/gitversion/execute@v0.9.7
      with:
        useConfigFile: true 

Context

This blocks our transition of all .NET projects from upgrading to .NET 6, as the added runtime and “temporary” change of the workaround makes an upgrade not feasible.

Your Environment

GitHub Actions environment, I’ve added the CI pipeline above

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

As a workaround you can set the environment variable DOTNET_ROLL_FORWARD to Major until .NET 6 support is released.

Actually there is no need for a new action to be released, as the actions can install by specifying a version number. There is no exact release date yet, there are some infrastructure changes needed to be done. I hope in a week or 2 to have everything solved and a 5.8.0 release to be done