How to create a scaffold for .NET project
Create the folders
mkdir MyProject
cd MyProject
mkdir src test
Create the project files
dotnet new classlib -o src/Library
dotnet new xunit -o test/Library.Tests
dotnet add test/Library.Tests/Library.Tests.csproj reference src/Library/Library.csproj
Making a Web API
dotnet new webapi -o src/WebApi
Making a console application
dotnet new console -o src/MyConsole
Run the tests
dotnet test test/Library.Tests/Library.Tests.csproj
Or run and watch for changes
dotnet watch --project test/Library.Tests/ test
Create the solution file
-n is optional, will default to folder name
dotnet new sln -n MyProject
Add projects to solution
dotnet sln MyProject.sln add src/Library/Library.csproj test/Library.Tests/Library.Tests.csproj
Run tests from solution
dotnet test MyProject.sln
Or run and watch tests from solution
dotnet watch --project MyProject.sln test
Run console application with input file
touch input.txt
dotnet run --project src/MyConsole/MyConsole.csproj < input.txt