# dotnet new Templates The Particular [dotnet new](https://learn.microsoft.com/dotnet/core/tools/dotnet-new) templates make it easier to bootstrap a variety of common project and code-related scenarios. > [!NOTE] > 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](https://learn.microsoft.com/dotnet/core/tools/dotnet-new). ## Installation Install using the following command: ```txt // install latest version dotnet new install ParticularTemplates ``` If a specific version is needed, follow the guidance in the [dotnet new install documentation](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new-install#examples). ## NServiceBus Windows Service This template makes it easier to create a [Windows Service](https://learn.microsoft.com/en-us/dotnet/framework/windows-services/introduction-to-windows-service-applications) host for an NServiceBus endpoint. The template can be used via the following command: ```txt 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: ```txt dotnet new nsbwinservice --name MyWindowsService dotnet sln add "MyWindowsService/MyWindowsService.csproj" ``` ### Options ```txt dotnet new nsbwinservice --help ``` #### Target Framework The target framework for the project. `-f|--framework` Default: `net462` Supported: `netcoreapp3.1`, `netcoreapp2.1`, `net48`, `net472`, `net471`, `net47`, `net462`, `net461` > [!NOTE] > 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](/nservicebus/hosting/windows-service.md) for details. ## ServiceControl Transport Adapter Windows Service > [!WARNING] > [ServiceControl.TransportAdapter](/nservicebus/upgrades/supported-versions.md#other-packages-servicecontrol-transportadapter) is obsolete. Instead, use the [`NServiceBus.Transport.Bridge`](/nservicebus/bridge/index.md). This template makes it easier to create a [Windows Service](https://learn.microsoft.com/en-us/dotnet/framework/windows-services/introduction-to-windows-service-applications) host for a [ServiceControl Transport Adapter](/servicecontrol/transport-adapter.md). The template can be used via the following command: ```txt 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: ```txt dotnet new scadapterwinservice --name MyAdapter dotnet sln add "MyAdapter/MyAdapter.csproj" ``` ### Options ```txt dotnet new scadapterwinservice --help ``` partial: target-framework > [!NOTE] > 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](/nservicebus/hosting/windows-service.md) for details. ## NServiceBus Docker Container This template makes it easier to create a [Docker](https://www.docker.com/) container host for an NServiceBus endpoint. The template follows the approach outlined in [Docker Container Host](/nservicebus/hosting/docker-host/index.md). The template can be used via the following command: ```txt 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: ```txt 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: ```txt docker build -f Dockerfile -t MyEndpoint ./.. ```