See dotnet new list for recipes.
Write Code and Exercise It Using Tests
dotnet new classlib --name Foo
dotnet new mstest --name Foo.Tests
dotnet reference add Foo/Foo.csproj --project Foo.Tests/Foo.Tests.csproj
dotnet new solution --name Foo
dotnet solution Foo.slnx add Foo/Foo.csproj
dotnet solution Foo.slnx add Foo.Tests/Foo.Tests.csproj
Formatting and Linting
dotnet new editorconfig --empty true
… and have <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> in the
.csproj.
References
- ESLint your C# in VS Code with Roslyn Analyzers | johnnyreilly. John Reilly. johnnyreilly.com . Apr 6, 2022. Accessed Nov 1, 2026.