Quick start: dotnet core solution with test project

Tom Dane
1 min readJan 7, 2019

--

Are you trying to create a dotnet core solution with a test project?

Run these commands to get started:

mkdir YourSolution
cd YourSolution
dotnet new sln --name YourSolution

Create project directory

mkdir YourProject
cd YourProject

Create any kind of project you like! Examples:

dotnet new consoledotnet new webapi

See all templates:

dotnet new --help

Add the project to the solution

cd ..
dotnet sln add YourProject/YourProject.csproj

Repeat those same steps for your test project:

mkdir YourProjectTests
cd YourProjectTests
dotnet new xunit
cd ..
dotnet sln add YourProjectTests/YourProjectTests.csproj

Finally

dotnet restore
dotnet build
dotnet test

You have your first test!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Tom Dane
Tom Dane

No responses yet

Write a response