How to change C# version in Visual Studio 2022?

Shervan360 1,681 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 | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Developer technologies | C#
Developer technologies | 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.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Jack J Jun 25,316 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.