You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's a C# 11 feature; see dotnet/csharplang#373 and What's new in C# 11. According to C# language versioning, "C# 11 is supported only on .NET 7 and newer versions." So it's by design that you get an error on .NET SDK 6.0.418. But I wonder why C# Extension and C# Dev Kit allow this code.
Per Kalle, looks like this is a new feature. Feel free to file a devkit issue if you believe it should be flagged in the UI rather than in the build. By design for the sdk though.
Describe the bug
If I try to build project that have the following code in the project I get
in the terminal.
[Route($"{nameof(paramName)}")] public async Task<IActionResult<bool>> GetValue(string paramName) { // some code... }
But if I try to build same code/project through solution explorer in vs code like in the following picture I do not get any error.
And also I do not get any error from VS Code telling the above error. I get only if I run dotnet build command in the terminal.
I don't know if this error is caused by C# Extension or dotnet SDK. I wanted to post bug here.
To Reproduce
a. By Solution Explorer like in the image
b. By dotnet build command in terminal
Further technical details
The text was updated successfully, but these errors were encountered: