<commit_before>---
title: How to install your NServiceBus license file
summary: 'Make sure your NServiceBus endpoints use your license: Configuration API, app.config, subfolder in your BIN directory, or registry.'
tags:
- license
redirects:
 - nservicebus/license-management
---

## Overview

There are several ways to make sure that your NServiceBus endpoints pick up and use your license.


## Using the Registry

NOTE: Using the Powershell cmdlet is the preferred and simpliest method of adding the license file. 

Using the registry to store your license information is a way that all platform tools can access this information easily. This includes NServiceBus endpoints, ServiceControl, and ServiceInsight. (ServicePulse determines licensing status by querying the ServiceControl API.) Using the registry ensures that all the platform tools can access the license status without requiring additional complexity on every deployment.


### NServiceBus Version 4.5 and above

The standalone NServiceBus PowerShell Version 5.0 includes a commandlet for importing the Platform License into the `HKEY_LOCAL_MACHINE` registry. See [Managing Using PowerShell](/nservicebus/operations/management-using-powershell.md) for more details and installation instructions for the PowerShell Module.

For 64-bit operating systems the license is written to both the 32-bit and 64-bit registry. The license is stored is `HKEY_LOCAL_MACHINE\Software\ParticularSoftware\License` and `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ParticularSoftware`

#### Advanced Registry Options

These following instructions cover installing the license file without using NServiceBus PowerShell Module. These options give a bit more flexibility as they allow you to store the the license in `HKEY_CURRENT_USER` if you wish. If the licenses is stored in `HKEY_CURRENT_USER` it is only accessible to the current user.

##### Using PowerShell Script 

* Open an administrative PowerShell prompt.
* Change the current working directory to where your license.xml file is.
* Run the following script

```
$content = Get-Content license.xml | Out-String
Set-ItemProperty -Path HKLM:\Software\ParticularSoftware -Name License -Force -Value $content
```

If modifying the registry directly using Registry Editor or a PowerShell script to update the license for ServiceControl, you will need to restart the ServiceControl service, as it only checks for its license information once at startup.

NOTE: For 64 bit operating systems repeat the process in both the Powershell prompt and the PowerShell(x86) console prompt.  This will ensure the license is imported into both the 32 bit and 64 bit registry keys. 

##### Using Registry Editor

- Run `regedit.exe` (usually located in `%windir%`, e.g. `C:\Windows`)
- Go to `HKEY_LOCAL_MACHINE\Software\ParticularSoftware` or `HKEY_CURRENT_USER\Software\ParticularSoftware`
- Create a new Multi-String Value (`REG_MULTI_SZ`) named `License`
- Paste the contents of the license file you received from Particular Software.

If `HKEY_LOCAL_MACHINE`is the chosen license location and the operating system is 64-bit then repeat the import process for the `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ParticularSoftware` key to support 32-bit clients.

(You can safely ignore any warnings regarding empty strings.)

### NServiceBus Version 3.3

NServiceBus Version 3.3 supports storing the license in a registry key called `[HKEYCURRENTUSER\Software\NServiceBus\{Major.Minor}\License]`.

To install the license in the registry, use one of these options:

 * The `LicenseInstaller.exe` tool that comes with the NServiceBus install.
 * The [Install-License](/nservicebus/operations/management-using-powershell.md) PowerShell commandlet.
 * If your trial license has expired and you are running in debug mode, the endpoint shows you a dialog that enables you to install the license.

<commit_msg>Update license-management.md<commit_after>---
title: How to install your NServiceBus license file
summary: 'Make sure your NServiceBus endpoints use your license: Configuration API, app.config, subfolder in your BIN directory, or registry.'
tags:
- license
redirects:
 - nservicebus/license-management
---

## Overview

There are several ways to make sure that your NServiceBus endpoints pick up and use your license.


## Using the Registry

NOTE: Using the Powershell cmdlet is the preferred and simpliest method of adding the license file. 

Using the registry to store your license information is a way that all platform tools can access this information easily. This includes NServiceBus endpoints, ServiceControl, and ServiceInsight. (ServicePulse determines licensing status by querying the ServiceControl API.) Using the registry ensures that all the platform tools can access the license status without requiring additional complexity on every deployment.


### NServiceBus Version 4.5 and above

The standalone NServiceBus PowerShell Version 5.0 includes a commandlet for importing the Platform License into the `HKEY_LOCAL_MACHINE` registry. See [Managing Using PowerShell](/nservicebus/operations/management-using-powershell.md) for more details and installation instructions for the PowerShell Module.

For 64-bit operating systems the license is written to both the 32-bit and 64-bit registry. The license is stored is `HKEY_LOCAL_MACHINE\Software\ParticularSoftware\License` and `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ParticularSoftware`


#### Advanced Registry Options

These following instructions cover installing the license file without using NServiceBus PowerShell Module. These options give a bit more flexibility as they allow you to store the the license in `HKEY_CURRENT_USER` if you wish. If the licenses is stored in `HKEY_CURRENT_USER` it is only accessible to the current user.


##### Using PowerShell Script 

* Open an administrative PowerShell prompt.
* Change the current working directory to where your license.xml file is.
* Run the following script

```
$content = Get-Content license.xml | Out-String
Set-ItemProperty -Path HKLM:\Software\ParticularSoftware -Name License -Force -Value $content
```

If modifying the registry directly using Registry Editor or a PowerShell script to update the license for ServiceControl, you will need to restart the ServiceControl service, as it only checks for its license information once at startup.

NOTE: For 64 bit operating systems repeat the process in both the Powershell prompt and the PowerShell(x86) console prompt.  This will ensure the license is imported into both the 32 bit and 64 bit registry keys. 


##### Using Registry Editor

- Run `regedit.exe` (usually located in `%windir%`, e.g. `C:\Windows`)
- Go to `HKEY_LOCAL_MACHINE\Software\ParticularSoftware` or `HKEY_CURRENT_USER\Software\ParticularSoftware`
- Create a new Multi-String Value (`REG_MULTI_SZ`) named `License`
- Paste the contents of the license file you received from Particular Software.

If `HKEY_LOCAL_MACHINE`is the chosen license location and the operating system is 64-bit then repeat the import process for the `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ParticularSoftware` key to support 32-bit clients.

(You can safely ignore any warnings regarding empty strings.)


### NServiceBus Version 3.3

NServiceBus Version 3.3 supports storing the license in a registry key called `[HKEYCURRENTUSER\Software\NServiceBus\{Major.Minor}\License]`.

To install the license in the registry, use one of these options:

 * The `LicenseInstaller.exe` tool that comes with the NServiceBus install.
 * The [Install-License](/nservicebus/operations/management-using-powershell.md) PowerShell commandlet.
 * If your trial license has expired and you are running in debug mode, the endpoint shows you a dialog that enables you to install the license.


{'fraction_non_alphanumeric': 0.05626204238921002, 'fraction_numerical': 0.008734746307000642, 'mean_word_length': 5.06386292834891, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '966707', 'n_tokens_mistral': 2044, 'n_tokens_neox': 1890, 'n_words': 967}