Edit on GitHub

Create new Projects with 'web new'

All ServiceStack Projects can be created using the .NET Core web tool:

$ dotnet tool install --global web 

If you had a previous version installed, update with:

$ dotnet tool update -g web

All features from the cross-platform web .NET Core tool are also available from the .NET Core Windows Desktop app tool:

$ dotnet tool install --global app 

Usage

To view a list of projects run:

$ web new

Where it will display all repositories in .NET Core, .NET Framework and ASP.NET Core Framework GitHub Orgs:

  .NET Core C# Templates
web .NET Core 3.1 Empty Website
angular-spa .NET Core 3.1 Angular 8 CLI Bootstrap App
aurelia-spa .NET Core 3.1 Aurelia CLI Bootstrap App
grpc .NET Core 3.1 gRPC Services
mvc .NET Core 3.1 MVC Website
mvcauth .NET Core 3.1 MVC Website integrated with ServiceStack Auth
mvcidentity .NET Core 3.1 MVC Website integrated with ServiceStack using MVC Identity Auth
mvcidentityserver .NET Core 3.1 MVC Website integrated with ServiceStack using IdentityServer4 Auth
parcel .NET Core 3.1 Parcel TypeScript App
parcel-webapp .NET Core 3.1 Parcel Sharp Apps
razor .NET Core 3.1 Website with ServiceStack.Razor
react-lite .NET Core 3.1 simple + lite (npm-free) React SPA using TypeScript
react-spa .NET Core 3.1 React Create App CLI Bootstrap App
selfhost .NET Core 3.1 self-hosting Console App
script .NET Core 3.1 #Script Pages Bootstrap Website
svelte-spa .NET Core 3.1 Svelte v3 Rollup Bootstrap App
vue-lite .NET Core 3.1 simple + lite (npm-free) Vue SPA using TypeScript
vue-nuxt .NET Core 3.1 Nuxt.js SPA App with Bootstrap
vue-spa .NET Core 3.1 Vue CLI Bootstrap App
vuetify-nuxt .NET Core 3.1 Nuxt.js SPA App with Material Vuetify
vuetify-spa .NET Core 3.1 Vue CLI App with Material Vuetify
worker-rabbitmq .NET Core 3.1 Rabbit MQ Worker Service
worker-redismq .NET Core 3.1 Redis MQ Worker Service
worker-servicebus .NET Core 3.1 Azure Service Bus MQ Worker Service
worker-sqs .NET Core 3.1 AWS SQS MQ Worker Service
bare-webapp .NET Core 3.1 Bare Sharp Apps
rockwind-webapp .NET Core 3.1 Rockwind Sharp Apps
angular-lite-spa .NET Core 3.1 Angular 4 Material Design Lite Webpack App
  ASP.NET Core Framework Templates
web-corefx .NET Framework ASP.NET Core Website
vue-lite-corefx .NET Framework ASP.NET Core lite (npm-free) Vue SPA using TypeScript
react-lite-corefx .NET Framework ASP.NET Core lite (npm-free) React SPA using TypeScript
script-corefx .NET Framework ASP.NET Core #Script Pages Bootstrap Website
razor-corefx .NET Framework ASP.NET Core Website with ServiceStack.Razor
mvc-corefx .NET Framework ASP.NET Core MVC Website
selfhost-corefx .NET Framework ASP.NET Core self-hosting Console App
  .NET Framework C# Templates
angular-lite-spa-netfx .NET Framework Angular 4 Material Design Lite Webpack App
angular-spa-netfx .NET Framework Angular 8 Bootstrap cli.angular.io App
aurelia-spa-netfx .NET Framework Aurelia Bootstrap Webpack App
mvc-netfx .NET Framework MVC Website
razor-netfx .NET Framework Website with ServiceStack.Razor
react-desktop-apps-netfx .NET Framework React Desktop Apps
react-spa-netfx .NET Framework React Bootstrap Webpack App
selfhost-netfx .NET Framework self-hosting HttpListener Console App
script-netfx .NET Framework #Script Pages Bootstrap WebApp
vue-nuxt-netfx .NET Framework Vue Nuxt.js SPA Web App
vue-spa-netfx .NET Framework Vue Bootstrap Webpack App
vuetify-nuxt-netfx .NET Framework Vuetify Material Nuxt.js SPA Web App
vuetify-spa-netfx .NET Framework Vuetify Material Webpack App
web-netfx .NET Framework Empty Website
winservice-netfx .NET Framework Windows Service

Usage

web new <template> <name>

For example to create a new Vue Single Page App, run:

$ web new vue-spa ProjectName

Modernized Project Templates

The ASP.NET Core Project Templates have been upgraded to use the latest external dependencies and have all been rewritten to take advantage of the ServiceStack Features added in this release, namely:

Auth Enabled Project Templates

Most Project Templates are now integrated with Credentials Auth and Facebook, Google and Facebook 3rd Party OAuth providers, complete with protected Pages and Services and auth redirect flow to Sign In and Forbidden pages.

angular-spa

Angular 8 CLI Bootstrap App

$ web new angular-spa ProjectName            # .NET Core
$ web new angular-spa-netfx ProjectName      # Classic ASP.NET on .NET Framework

mvcauth

.NET Core 2.2 MVC Website integrated with ServiceStack Auth

$ web new mvcauth ProjectName                # .NET Core

mvcidentity

.NET Core 2.2 MVC Website integrated with ServiceStack using MVC Identity Auth

$ web new mvcidentity ProjectName            # .NET Core

mvcidentityserver

.NET Core 2.1 MVC Website integrated with ServiceStack using IdentityServer4 Auth

$ web new mvcidentityserver ProjectName      # .NET Core

razor

ServiceStack.Razor Bootstrap Website

$ web new razor ProjectName                  # .NET Core
$ web new razor-corefx ProjectName           # ASP.NET Core on .NET Framework
$ web new razor-netfx ProjectName            # Classic ASP.NET on .NET Framework

react-spa

React Create App CLI Bootstrap App

$ web new react-spa ProjectName              # .NET Core
$ web new react-spa-netfx ProjectName        # Classic ASP.NET on .NET Framework

react-lite

ASP.NET Core Simple + lite (npm-free) React SPA using TypeScript

$ web new react-lite ProjectName             # .NET Core
$ web new react-lite-corefx ProjectName      # ASP.NET Core on .NET Framework

script

#Script Pages Bootstrap Website

$ web new script ProjectName                 # .NET Core
$ web new script-corefx ProjectName          # ASP.NET Core on .NET Framework
$ web new script-netfx ProjectName           # Classic ASP.NET on .NET Framework

vue-spa

Vue CLI Bootstrap App

$ web new vue-spa ProjectName                # .NET Core
$ web new vue-spa-netfx ProjectName          # Classic ASP.NET on .NET Framework

vue-lite

ASP.NET Core Simple + lite (npm-free) Vue SPA using TypeScript

$ web new vue-lite ProjectName               # .NET Core
$ web new vue-lite-corefx ProjectName        # ASP.NET Core on .NET Framework

vue-nuxt

Nuxt.js SPA App with Bootstrap

$ web new vue-nuxt ProjectName               # .NET Core
$ web new vue-nuxt-netfx ProjectName         # Classic ASP.NET on .NET Framework

Create Customized Projects with mix

All new projects can be further customized with mix dotnet tool to mix in additional “layered” features.

Why a new project template system?

It’s not often that a tool causes enough friction that it ends up requiring less effort to develop a replacement than it is to continue using the tool. But this has been our experience with maintaining our VS.NET Templates in the ServiceStackVS VS.NET Extension which has been the biggest time sink of all our 3rd Party Integrations where the iteration time to check in a change, wait for CI build, uninstall/re-install the VS.NET extension and create and test new projects is measured in hours not minutes. To top off the poor development experience we’ve now appeared to have reached the limits of the number of Project Templates we can bundle in our 5MB ServiceStackVS.vsix VS.NET Extension as a number of Customers have reported seeing VS.NET warning messages that ServiceStackVS is taking too long to load.

Given all the scenarios ServiceStack can be used in, we needed a quicker way to create, update and test our growing 47 starting project templates. In the age of simple command-line dev tools like git and .NET Core’s light weight text/human friendly projects, maintaining and creating new .NET project templates still feels archaic & legacy requiring packaging projects as binary blobs in NuGet packages which become stale the moment they’re created.

How it works

GitHub powered Project Templates

Especially for SPA projects which need to be frequently updated, the existing .NET Project Templates system is a stale solution that doesn’t offer much benefit over maintaining individual GitHub projects, which is exactly what the dotnet-new npm tool and now web new .NET Core are designed around.

Inside dotnet-new and web new is an easier way to create and share any kind of project templates which are easier for developers to create, test, maintain and install. So if you’re looking for a simpler way to be able to create and maintain your own value-added project templates with additional bespoke customizations, functionality, dependencies and configuration, using web new is a great way to maintain and share them.

Using GitHub for maintaining project templates yields us a lot of natural benefits:

Always up to date

Importantly end users will always be able to view the latest list of project templates and create projects using the latest available version, even if using older versions of the tools as they query GitHub’s public APIs to list all currently available projects that for installation will use the latest published release (or master if there are no published releases), which if available, downloads, caches and creates new projects from the latest published .zip release.

Just regular Projects

Best of all creating and testing projects are now much easier since project templates are just working projects following a simple naming convention that when a new project is created with:

$ web new <template> ProjectName

Replaces all occurrences in all text files, file and directory names, where:

The tool installer then inspects the project contents and depending on what it finds will:

That after installation is complete, results in newly created projects being all setup and ready to run.

Available project templates

One missing detail is how it finds which GitHub repo should be installed from the <template> name.

This can be configured with the APP_SOURCE_TEMPLATES Environment variable to configure the web tool to use your own GitHub organizations instead, e.g:

APP_SOURCE_TEMPLATES=NetCoreTemplates;NetFrameworkTemplates;NetFrameworkCoreTemplates

Optionally you can display a friendly name next to each Organization name, e.g:

APP_SOURCE_TEMPLATES=NetCoreTemplates .NET Core C# Templates;

web new will then use the first GitHub Repo that matches the <template> name from all your GitHub Sources, so this does require that all repos have unique names across all your configured GitHub Sources.

These are the only sources web new looks at to create ServiceStack projects, which by default is configured to use NetCoreTemplates, NetFrameworkTemplates and NetFrameworkCoreTemplates GitHub Organizations, whose repos will be listed when running:

$ web new

Troubleshooting

web: command not found

If after installing the dotnet web tool it fails with bash: web: command not found you’ll need to add dotnet tools to your PATH which you can do in Linux Bash with:

$ echo "export PATH=\$HOME/.dotnet/tools:\$PATH" >> ~/.bashrc
$ . ~/.bashrc

SSL Connection Errors

To resolve SSL Connection errors you can try commenting out ssl_conf = ssl_sect, e.g:

$ sudo vi /etc/ssl/openssl.cnf

Comment out line in vi using a # prefix, write changes and quit:

:%s/^ssl_conf/#&/
:wq

If that doesn’t resolve the issue you can try updating the local ca-certificates:

$ sudo update-ca-certificates --fresh

Or try updating the SSL_CERT Environment variables before running the tool again:

export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
export SSL_CERT_DIR=/dev/null

Finally you can try running the web tool with the --ignore-ssl-errors switch, e.g:

$ web new vue-lite VueLite --ignore-ssl-errors