Skip to content

With .NET 6 Preview6, build netstandard2.0 classlib failed with error: CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater.  #3297

@NicoleWang001

Description

@NicoleWang001

Repro steps:

  1. Install .NET 6 Preview6 SDK
  2. Create a new netstandard2.0 classlib and build it

Expected Result:
Classlib could be built successfully

Actual Result:
build netstandard2.0 classlib failed with error:

Microsoft (R) Build Engine version 17.0.0-preview-21304-01+a5ea6d2ca for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
 
  Determining projects to restore...
  All projects are up-to-date for restore.
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater. [/home/nicole/myclass1/myclass1.csproj]
 
Build FAILED.
 
CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater. [/home/nicole/myclass1/myclass1.csproj]
    0 Warning(s)
    1 Error(s)
 
Time Elapsed 00:00:00.83

Note: It not repro with .NET 6 Preview5

Dotnet info:
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.6.21315.23
Commit: 8f09936962

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.6.21315.23\

Host (useful for support):
Version: 6.0.0-preview.6.21306.1
Commit: 5b8e1780ad

.NET SDKs installed:
6.0.100-preview.5.21302.13 [C:\Program Files\dotnet\sdk]
6.0.100-preview.6.21315.23 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.5.21301.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.6.21306.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.5.21301.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.6.21306.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.5.21301.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.6.21305.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Metadata

Metadata

Assignees

Labels

triagedThe issue was evaluated by the triage team, placed on correct area, next action defined.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions