Visual Studio will use the C# language as specified by the framework. This is documented here.
You can override by adding the LangVersion
element to your project file. But this may or may not work. What is implemented by the compiler and what requires runtime support has been blurred. Therefore even if you get the code to compile it might not necessarily run.
Finally note that to support C# 10 you'll need to be running the version of the build that supports it which means you'll need at least VS 2022. Even if you set the lang version to a valid value if MSBuild doesn't support it because it is too old then it won't work.