Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

dotnet new Templates

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

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: netcoreapp2.1, net472, net471, net47, net462, net461, net46, net452

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

partial: target-framework

NServiceBus Docker Container

This template makes it easier to create a Docker container host for an NServiceBus endpoint. The template follows the approach outlined in Docker Container Host.

The template can be used via the following command:

dotnet new nsbdockercontainer --name MyEndpoint

This will create a new directory named MyEndpoint containing a .csproj also named MyEndpoint.

To add to an existing solution:

dotnet new nsbdockercontainer --name MyEndpoint
dotnet sln add "MyEndpoint/MyEndpoint.csproj"

To build the Docker image, open the command line, change to the directory containing the endpoint's .csproj, and run the following command:

docker build -f Dockerfile -t MyEndpoint ./..

Related Articles