I've updated an existing asp.net mvc app from netcoreapp3.0 to netcoreapp3.1, along with all referenced packages. The project settings have the target framework and my PC has the SDK installed
<TargetFramework>netcoreapp3.1</TargetFramework>
I have an error in a place where I use the C# coaslescing assignment feature ??=
This was working without issue before updating. @SebastianHofmann has kindly confirmed other C#8 features do not work either.
Error CS8370 Feature 'coalescing assignment' is not available in C# 7.3.
Please use language version 8.0 or greater.
According to MSFT netcoreapp3.1 should be using C#8 and indeed must
The advance project settings I just saw has been disabled within Visual Studio 2019 (16.3.10)
I can toggle back to 3.0 and it compiles again
I've added ??= to an existing Core 3 project and had no errors, then updated VS with latest patch (V 4.7.03062) to get 3.1, then upgraded the project to 3.1 also with no error. the only way I could get your error was down grading the project to 2.1. Is it worth running a repair / update on your VS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With