Alias Any Type in C#12

Shervan360 1,521 Reputation points
2024-08-23T06:11:15.7766667+00:00

Hello,

I want to use the new feature in C#12, but the compiler doesn't know this feature.

Screenshot 2024-08-23 093329

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,838 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 64,006 Reputation points
    2024-08-23T15:25:11.9833333+00:00

    Your issue is that type alias definitions are not allowed in code blocks. Move the definition to before the class definition.

    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.