NetEscapades.Templating
June 1, 2018 ยท View on GitHub
NetEscapades.Templating
Templates for use with the the .NET CLI's dotnet new functionality
How to install the templates
- You must have the latest version of the dotnet tooling. This comes with Visual Studio 2017 or from https://dot.net.
- Run
dotnet new --install "NetEscapades.Templates::*"to install the project template. - Run
dotnet new basicwebapi --helpto see how to select the features of the project. - Run
dotnew new basicwebapi --name "MyTemplate"along with any other custom options to create a project from the template.
Info for dotnet new users
You can create new projects with dotnet new. For more info take a look at
Announcing .NET Core Tools Updates in VS 2017 RC. For further details, check out the excellent blog posts by Muhammed Rehan Saeed.
Running the project after it's generated
Once you have created a new project using dotnet new, you must restore packages before using dotnet run.
dotnet new basicwebapi --name "MyProject"
dotnet restore
dotnet run
General info on installing templates
Templates can be installed from packages in any NuGet feed, directories on the file system or ZIP type archives (zip, nupkg, vsix, etc.) To install a new template use the command:
dotnet new -i {the path to the folder containing the templates}
Basic Commands
Showing help
dotnet new --help
dotnet new -h
dotnet new
Listing templates
dotnet new --list
dotnet new -l
dotnet new mvc -l Lists all templates containing the text "mvc"
Template parameter help
dotnet new mvc --help
dotnet new mvc -h
Template creation
dotnet new MvcWebTemplate --name MyProject --output src --ParameterName1 Value1 --ParameterName2 Value2 ... --ParameterNameN ValueN
dotnet new MvcWebTemplate -n MyProject -o src --ParameterName1 Value1 --ParameterName2 Value2 ... --ParameterNameN ValueN