question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action fails for C# 8

See original GitHub issue

I have a C# 8 project that uses C# 8 syntax

I have a simple action to build it:

name: ASP.NET Core CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.2.108
    - name: Build with dotnet
      run: dotnet build --configuration Release

However, this throws an error whenever it encounters C# 8 syntax.

I should be able to force the lang version in the .csproj file with <LangVersion>8.0</LangVersion>, but this errors with CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. [/home/runner/work/...myproject.csproj]

How do I upgrade this action to compile a C#8 project?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
plioicommented, May 25, 2020

If that’s not actually evidence of anything wrong with setup-dotnet, I’ll chalk it up to my Solution being weird 😃. That should be a temporary setback for me, and I’ll submit a fresh Issue if I still have trouble once all projects target netcoreapp3.1+.

0reactions
plioicommented, May 25, 2020

I wondered if that was the case, so I tried again with two invocations of setup-dotnet:

https://github.com/fixie/fixie/runs/704723182

Using the following definition:

name: CI
on: [push, pull_request]
jobs:
  ci:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest, macos-latest, ubuntu-latest]
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Setup .NET Core 2 (Deprecated `dotnet fixie` Support)
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.1.806
    - name: Setup .NET Core 3
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.201
    - run: pwsh ./build.ps1

Ubuntu fails with errors about missing C# 8. Both invocations of setup-dotnet appear to succeed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error on Github Actions: could not import C (cgo ...
Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported. Yes, I've searched similar issues on ...
Read more >
C8 Class Action Settlement
A class action lawsuit against DuPont on behalf of persons in the Parkersburg regional area affected by C-8 water contamination was certified by...
Read more >
C - Error Handling - Tutorialspoint
So a C programmer can check the returned values and can take appropriate action depending on the return value. It is a good...
Read more >
Custom Action in C# used via WiX fails with error 1154
The WiX | C# Custom Action project should output Foo.dll and Foo.CA.dll. You want the later in your installer. ... Any one of...
Read more >
C interpreter run time error: Action.c (25) - Google Groups
Am getting the following C interpreter run time error while replying the Script ... Action.c(8): Error -26377: No match found for the requested...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found