Component: NServiceBus
NuGet Package NServiceBus (4.x)
Standard support for version 4.x of NServiceBus has expired. For more information see our Support Policy.

License details

See the Licensing page for license specifics.

License validity

Version 3 to 4.5

The license is valid if the LicenseVersion attribute in the license data is greater than or equal to the {major}.{minor} part of the fileversion for the NServiceBus assembly used by the endpoint.

Version 4.5 to 5

The license is valid if the ExpirationDate or the UpgradeProtectionExpiration attribute in the license data is greater than or equal to the release date of the {major}.{minor}.0 version of the NServiceBus assembly used by the endpoint. To view the release dates for the various versions, see NServiceBus Packages Versions.

Only the Major/Minor part is relevant. Eg. if using NServiceBus 6.1.1 it's the release date of 6.1.0 that counts.

Throughput limitations

Versions 4.5

No limitations are enforced when either no license is found or a license has expired.

Versions 4.0 to 4.5

If running with no license the endpoint will restrict the maximum message throughput to 1 msg/s. Unlike Version 3 the number of threads is kept unlimited.

License management

There are several options available for installing the license file.

While all of the options below work for NServiceBus, using the registry, ServiceControl utilities, or ServiceInsight are the only options that lets the other platform tools share the same license file. More information about this can be found in the ServiceControl licensing and the ServiceInsight licensing pages.

Using the registry

NServiceBus PowerShell cmdlet

The NServiceBus PowerShell Module includes a cmdlet for importing the Platform License into the HKEY_LOCAL_MACHINE root key of the registry.

For 64-bit operating systems, the license is stored under "license" value in both the HKEY_LOCAL_MACHINE\Software\ParticularSoftware and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ParticularSoftware registry keys.


  • Open an administrative PowerShell console.
  • Change the current working directory to where the license.xml file is.
  • Run the following script:
$content = Get-Content license.xml | Out-String
New-Item -Path HKLM:\Software\ParticularSoftware -Force 
Set-ItemProperty -Path HKLM:\Software\ParticularSoftware -Name License -Force -Value $content
For 64-bit operating systems, this process should be done in both the PowerShell and PowerShell(x86) consoles. This will ensure the license is imported into both the 32-bit and 64-bit registry keys.

Registry Editor

  • Start the Registry Editor.
  • 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.
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.
If the license is stored in HKEY_CURRENT_USER, NServiceBus processes must run as the user account used to add the license file to the registry in order to access the license.

It is safe to ignore any warnings regarding empty strings.

NServiceBus 4.x versions prior to Version 4.5

When installed using the Install-NServiceBusLicense PowerShell commandlet and the LicenseInstaller.exe tool that comes with the NServiceBus install, in NServiceBus Version 4.0, the license file was stored in HKEY_LOCAL_MACHINE\Software\NServiceBus\{Major.Minor}\License and in Version 4.3, this location was moved to HKEY_LOCAL_MACHINE\Software\ParticularSoftware\NServiceBus\License.

In order to install the license file in HKEY_CURRENT_USER (same location in Version 3.3), use the -c option on the LicenseInstaller.exe

Using the configuration API

It is possible to specify the license to use in the configuration code:

// or

Using a license subdirectory

A file located at [AppDomain.CurrentDomain.BaseDirectory]/License/License.xml will be automatically detected.

Using app.config appSettings

It is possible to specify the license in app.config:

  • Use the key NServiceBus/LicensePath to specify the path where NServiceBus looks for the license:
  <add key="NServiceBus/LicensePath"
       value="C:\NServiceBus\License\License.xml" />
  • Use the key NServiceBus/License to store the XML-encoded contents of the license directly in app.config:
  <add key="NServiceBus/License" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;
license id=&quot;1222e1d1-2222-4a46-b1c6-943c442ca710&quot; expiration=&quot;2013-11-30T00:00:00.0000000
&quot; type=&quot;Standard&quot; LicenseType=&quot;Standard&quot; LicenseVersion=&quot;4.0
&quot; MaxMessageThroughputPerSecond=&quot;Max&quot; WorkerThreads=&quot;Max
&quot; AllowedNumberOfWorkerNodes=&quot;Max&quot;&gt;
. . .
&lt;/license&gt;" />

Order of license detection

This section details where NServiceBus will look for license information, and in what order. For example, an expired license in HKEY_CURRENT_USER would overrule a valid license in HKEY_LOCAL_MACHINE. Note that these vary somewhat in older versions.

In order to find the license, NServiceBus will examine:

License XML defined by NServiceBus/License appSetting
File path configured through NServiceBus/LicensePath appSetting
File located at {AppDomain.CurrentDomain.BaseDirectory}\NServiceBus\License.xml
File located at {AppDomain.CurrentDomain.BaseDirectory}\License\License.xml
HKEY_LOCAL_MACHINE\Software\Wow6432Node\NServiceBus\{Version}\License1, 2


  1. The Wow6432Node registry keys are only accessed if running a 32-bit host on a 64-bit OS.
  2. Storing licenses in the registry by NServiceBus version was abandoned in NServiceBus 4.3. For backwards compatibility, newer versions of NServiceBus will still check this pattern for versions 4.0, 4.1, 4.2, and 4.3.


Failed to initialize the license

The license management code requires write permissions to store metadata. If the process credentials don't have write permissions the following fatal event log item can be generated:

FATAL NServiceBus.Features.LicenseReminder Failed to initialize the license
System.UnauthorizedAccessException: Access to the path 'C:\Windows\system32\config\systemprofile' is denied.

Ensure that the process has write permissions at the specified location. If necessary, either modify the location, change permissions, or use another process that has appropriate permissions.

Related Articles

Last modified