dotnet new Templates

The Particular dotnet new templates makes it easier to bootstrap a variety of common project and code related scenarios.

The dotnet new command creates a new project, configuration file, or solution based on the specified template. The command provides a convenient way to initialize a valid SDK-style project. The command calls the template engine to create the artifacts on disk based on the specified template and options. More information is available in the dotnet-new documentation.

Installation

Install using the following command:

dotnet new --install ParticularTemplates

NServiceBus Windows Service

This template makes it easier to create a Windows Service host for an NServiceBus endpoint.

The template can be used via the following command:

dotnet new nsbwinservice --name MyWindowsService

This will create a new directory named MyWindowsService containing a Windows Service .csproj also named MyWindowsService.

To add to an existing solution:

dotnet new nsbwinservice --name MyWindowsService
dotnet sln add "MyWindowsService/MyWindowsService.csproj"

Options

dotnet new nsbwinservice --help

Target Framework

The target framework for the project.

-f|--framework

Default: net462

Supported: net47, net462, net452

When installing an endpoint created from this template as a service, the --run-as-service parameter must be set on the command line. See Windows Service Installation for details.

ServiceControl Transport Adapter Windows Service

This template makes it easier to create a Windows Service host for a ServiceControl Transport Adapter.

The template can be used via the following command:

dotnet new scadapterwinservice --name MyAdapter

This will create a new directory named MyAdapter containing a windows service .csproj also named MyAdapter.

To add to an existing solution:

dotnet new scadapterwinservice --name MyAdapter
dotnet sln add "MyAdapter/MyAdapter.csproj"

Options

dotnet new scadapterwinservice --help

Target Framework

The target framework for the project.

-f|--framework

Default: net462

Supported: net47, net462, net452

When installing an endpoint created from this template as a service, the --run-as-service parameter must be set on the command line. See Windows Service Installation for details.

Samples

Related Articles


Last modified