Skip to content

Instantly share code, notes, and snippets.

@nth-block
Created August 23, 2017 03:17
Show Gist options
  • Save nth-block/fc2d8b6619f5218820324817bf8cbe0c to your computer and use it in GitHub Desktop.
Save nth-block/fc2d8b6619f5218820324817bf8cbe0c to your computer and use it in GitHub Desktop.
Dotnet core Cheat Sheet

Dotnet Core Cheat Sheet

This cheat sheet is courtesy Ben Day and is available here. This Markdown file is just for easy reference for programmers.

What follows are the excerpts from Ben's blog.

The nice thing about the items on this ‘cheat sheet’ is that they work on Windows, Mac, and Linux. [Note 2/13/2017: Want an example script? Check this out.

Create a new Solution (*.sln)

dotnet new sln

Create a new Class Library (*.csproj):

dotnet new classlib

Create a new Class Library (*.csproj) targeting .NET Core

dotnet new classlib -f netcoreapp1.1

Create a new ASP.NET MVC project:

dotnet new mvc

Create a new ASP.NET MVC project targeting .NET Core

dotnet new mvc -f netcoreapp1.1

Create a new MSTest unit test project targeting .NET Core

dotnet new mstest -f netcoreapp1.1

Add a project (.csproj) to a Solution (.sln)

dotnet sln MySolutionFile.sln add .\src\MySolution.WebUi\MySolution.WebUi.csproj

Add a reference from one Project to another

dotnet add reference ..\MySolution.Api\MySolution.Api.csproj

Restore NuGet dependencies so that you can be ready to do a build

dotnet restore

Use dotnet to do a build

dotnet build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment