dotnet new target framework code example

Example 1: dotnet new emty webapp

dotnet new web -o <Web app name>

Example 2: dotnet target specific framework

// global.json file in root of your project (as far as I understand, 
// where you execute the 'dotnet' command, the CLI is going to go upwards
// until it finds this file and respect its contents - this means that it
// should not affect any other projects - even though its name is global.json)
{
  "sdk": {
    "version": "3.0.0"
  }
}

Example 3: dotnet new options

dotnet new <TEMPLATE> [--dry-run] [--force] [-i|--install {PATH|NUGET_ID}]
    [-lang|--language {"C#"|"F#"|VB}] [-n|--name <OUTPUT_NAME>]
    [--nuget-source <SOURCE>] [-o|--output <OUTPUT_DIRECTORY>]
    [-u|--uninstall] [--update-apply] [--update-check] [Template options]

dotnet new <TEMPLATE> [-l|--list] [--type <TYPE>]

dotnet new -h|--help