R
R
Roman Koff2022-02-20 16:27:44
C++ / C#
Roman Koff, 2022-02-20 16:27:44

When opening a *.cshtml file (Asp.Net Core, Razor), how do I get Visual Studio to work with C# 10 (NET 6)?

Visual Studio 2022
If you add an existing site made on NET6 (Asp.Net Core) to the solution and try to edit any view file (*.cshtml), then the editor applies version 2.0 to the C# code (with all the ensuing consequences for code formatting).

How can I make it understand that this is C# version 10?

(naturally, when views are edited in the source project, everything opens normally there, like C # 10)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question