# Restricting C# Version in a .NET Project
You can see a list of all supported C# versions for a given compiler by running
```shell
csc -langversion:?
```
The easiest way of doing this is to open the relevant Visual Studio Developer Command Prompt and run it there.
**To restrict the C# version used in the current project you need to pin it by using the `LangVersion` property in csproj, or in [[Directory.Build.props and Directory.Build.targets files|Directory.Build.props]] file.**
```xml
<PropertyGroup>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
```
- `latest` will use latest minor version
- `preview` will use latest preview version
For a listing of all C# versions see [C# language versioning](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version).
The latest C# version supported by:
- Visual Studio 2017 is 7.3
- Visual Studio 2019 is 9.0