How to fix this?

BenTam 1,661 Reputation points
2024-03-24T08:45:29.0066667+00:00

Hello everyone,


CS8370 Feature 'static local functions' is not available in C# 7.3. Please use language version 8.0 or greater.


    Can someone please guide me on how to fix this issue?

Errors

  • I believe my Visual Studio can run C# 8.0 or 9.0. I'd like to know how to force my system to use C# 8.0 or 9.0.
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,903 questions
{count} votes

Accepted answer
  1. Karen Payne MVP 35,421 Reputation points
    2024-03-24T11:31:31.47+00:00

    Try the following.

    public static class Extensions
    {
        public static T IIf<T>(this bool expression, T truePart, T falsePart) 
            => expression ? truePart : falsePart;
    }
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.