I have an ASP.NET Core C # web application. I made some changes that now use C # 7.1 features. I changed the version of the project, so it compiles and works fine. However, when I try to publish a project, I get an error message:
The default literal function is not available in C # 7.0. Use language version 7.1 or higher.
Compile the command that I see:
C:...\.nuget\packages\microsoft.net.compilers\2.6.1\tools\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1705,1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;RELEASE;NETCOREAPP2_0 /errorendlocation /preferreduilang:en-US /warnaserror+:NU1605`
As suggested elsewhere, I installed Microsoft.Net.Compilers
(v2.6.1), but that didn't make any difference.
Is there a Visual Studio setting that affects publishing specifically?
The UPDATE . The console application does not seem to have this problem. If it is successfully built, it is also successfully published. However, the web application does not publish. Has anyone successfully published an ASP.NET Core web application with C # 7.1 features?
Felix source
share