How to change C# version in Visual Studio 2022?

Shervan360 1,661 Reputation points
2023-02-08T22:26:19.8266667+00:00

Hi,

I have VS 2022 with .NET7, I want to change the C# version to lower 7.0. How can I do this?

thank you

Developer technologies | Visual Studio | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Jack J Jun 25,296 Reputation points
    2023-02-09T01:29:04.8966667+00:00

    @Shervan360, Welcome to Microsoft Q&A, as the Microsoft Learning C# language versioning said, .NET version has some correspond relationship with the c# version.

    User's image

    If you want to use lower 7.0 c# version, you could downgrade your Target Framework from .NET 7 to .NET Core 2.x or .NET Framework.

    Hope my solution could help you.

    Best Regards,

    Jack


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.
    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.