Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use C# 7.3 with .Net Framework 4.6.1?

I'm interested in enum generic constraints, but when I'm switching language version for project on Build → Advanced I'm still getting error «not available in C#5; please use language version 7.3 or greater» even after reopening the project.
Project type is an ASP.NET MVC application.

like image 254
Troll the Legacy Avatar asked Sep 20 '18 08:09

Troll the Legacy


1 Answers

I've installed Microsoft.Net.Compilers and Microsoft.CodeDom.Providers.DotNetCompilerPlatform packages from Nuget, then changed in web.config system.codedom → compilers → compiler language="c#;cs;csharp" property langversion to 7.3, reloaded project and all worked.

like image 194
Troll the Legacy Avatar answered Sep 30 '22 02:09

Troll the Legacy