I'm trying to use a local function in my asp.net web-site:
public class Handler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
Int32 Seven()
{
return 7;
}
}
}
But i get an compile-time error:
CS8026 Feature 'local functions' is not available in C# 5. Please use language version 7.0 or greater.
Ok then.
How to use Language Version 7.0 or greater in an ASP.net web-site?
It seems everyone knows how to upgrade an ASP.net web-application to a newer version of C#. But how to you upgrade an ASP.net web-site to a newer version of C#?
CodePudding user response:
Changing the Target Framework to 4.8 should get you C# 7.3 features. C# features are standardized and correspond with the framework version.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version

