CLI

dotnet --version

Reports the selected SDK version for the current directory. Selection depends on SDK visibility and global.json; the result is not the application runtime version. Requires a selectable SDK.

Formal Syntax & Structure

csharp syntaxcsharp
dotnet --version

Working Example

Example Snippetcsharp
dotnet --version
C# & .NET Reference