Azure-pipelines-tasks: DotNetCoreCLI@2 doesn't work with C# 8

Created on 16 Apr 2019  路  2Comments  路  Source: microsoft/azure-pipelines-tasks

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: DotNetCoreCLI@2

Environment:

Azure Pipelines (/ondfisk/C5/14
Hosted on Azure DevOps

Issue Description

I'm trying to build my .NET Standard 2.0 project with Azure pipelines,
```steps:

  • task: DotNetCoreCLI@2
    inputs:
    command: build
    arguments: /P:SourceLinkCreate=false --configuration $(buildConfiguration)
    displayName: Build

It was working perfectly until I added support for Nullable Reference Types checking and C# 8 in my solution .csproj file:


8.0
enable


### Task logs

CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. [d:\a\1\s\C5\C5.csproj]

Build FAILED.

CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. [d:\a\1\s\C5\C5.csproj]
0 Warning(s)
1 Error(s)

Time Elapsed 00:01:45.50

[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1

[error]Dotnet command failed with non-zero exit code on the following projects :

[section]Finishing: Build

```

bug route

Most helpful comment

Yes, the solution came by adding

```steps:

  • task: DotNetCoreInstaller@0
    inputs:
    packageType: 'sdk'
    version: '3.0.100-preview3-010431'
    displayName: Install .NET Core 3

All 2 comments

Did you find a solution to this?

Yes, the solution came by adding

```steps:

  • task: DotNetCoreInstaller@0
    inputs:
    packageType: 'sdk'
    version: '3.0.100-preview3-010431'
    displayName: Install .NET Core 3
Was this page helpful?
0 / 5 - 0 ratings

Related issues

timfish picture timfish  路  3Comments

divyesh-parikh picture divyesh-parikh  路  3Comments

alexszilagyi picture alexszilagyi  路  3Comments

MichaelWhiteCodingForFun picture MichaelWhiteCodingForFun  路  3Comments

fedemkr picture fedemkr  路  3Comments