When targeting to multiple SDKs, winforms project build failed with error: CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater.
See original GitHub issue-
.NET Core Version: .NET SDK 6.0.100
-
More info:
- When targeting to multiple SDKs with
net5.0-windows;net48
, this issue also repro. - When targeting to multiple SDKs with
netcoreapp3.1;net48
, this issue doesn’t repro.
- Have you experienced this same bug with .NET Framework?: No
Actual behavior:
The WinForms project build failed with error: CSC : error CS8630: Invalid ‘nullable’ value: ‘Enable’ for C# 7.3. Please use language version ‘8.0’ or greater.
Expected behavior: The WinForms project could be built successfully
Minimal repro:
- Create a WinForms .NET core project
- Edit .csproj file and change the SDK in <TargetFramework> node
from
<TargetFramework>net6.0-windows</TargetFramework>
to<TargetFrameworks>net6.0-windows;net48</TargetFrameworks>
- Reload this project
- Build this project
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Invalid 'nullable' value - 'Enable' for C# 7.3
In my case, I ran into this problem with Visual Studio 2022 when I changed the target framework from .NET Standard 2.1 to...
Read more >Invalid Nullable Value - Enable for C# 7.3 - Attach to Process
Right-click YourProject, click Properties · Click Build if it's not already selected · Change Configuration to All Configurations · Click Advanced.
Read more >Using C# 8 and Nullable Reference Types in .NET Framework
Enabling Nullable Reference Types: The next step is to turn on the nullable reference types feature. If you are using the modern project...
Read more >enable for c# 7.3 please use language version 8.0 or greater
Use language version and greater Issue Description .NET build (MSBuild or Visual Studio) gives below or similar format of the error.
Read more >C# 8.0 nullable references: supporting older runtimes
In this post, I'll show how you can use C# 8.0's nullable reference features on code that needs to target versions of ....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Amy-Li03 please refer to https://docs.microsoft.com/dotnet/core/compatibility/sdk/6.0/csharp-template-code
😓