.NET CLI Commands
The dotnet command for building and running .NET apps.All .NET CLI pages
- dotnet format --verify-no-changes: format C# code and check it in CIdotnet format applies .editorconfig rules to C# code; --verify-no-changes exits 2 when files need formatting, for CI. Whitespace, style, analyzers, options.
- dotnet new console: create and run a C# console appdotnet new console -o MyApp creates a C# console project with top-level statements, and dotnet run builds and starts it. Options and other common templates.
- dotnet sln add: create a solution and add projects to itdotnet new sln and dotnet sln add put projects in one solution (.slnx in .NET 10). List, remove, solution folders, project references and the common pitfalls.
- dotnet test --filter: run a single test or a category in .NETdotnet test --filter runs one test or a category: FullyQualifiedName~Name, =, !=, Category=Slow, | and &. List test names and avoid quoting and MSB1011 issues.