Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

License file information

Component: NServiceBus
NuGet Package: NServiceBus (7.x)

License details

See the Licensing page for license specifics.

License validity

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.

Throughput limitations

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

License management

There are several options available for installing the license file.

Code-first configuration

A license can be configured via code-first configuration API:

endpointConfiguration.LicensePath("PathToLicense");
// or
endpointConfiguration.License("ContentsOfLicenseFile");

Application-specific license location

A license located at {AppDomain.CurrentDomain.BaseDirectory}/license.xml will be automatically detected.

User-specific license location

To install a license for all endpoints and Particular Service Platform applications run by a specific user, install the license file in the following location:

  • Windows: %LOCALAPPDATA%\ParticularSoftware\license.xml
  • Linux/macOS: ${XDG_DATA_HOME:-$HOME/.local/share}/ParticularSoftware/license.xml
  • macOS (.NET 8): $HOME/Library/Application Support/ParticularSoftware/license.xml

Machine-wide license location

To install a license for all endpoints and Particular Service Platform applications on an entire machine, install the license file in the following location:

  • Windows: %PROGRAMDATA%\ParticularSoftware\license.xml
  • Linux/macOS: /usr/share/ParticularSoftware/license.xml

Application configuration file

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:
<appSettings>
  <add key="NServiceBus/LicensePath"
       value="C:\NServiceBus\License\License.xml" />
</appSettings>
  • Use the key NServiceBus/License to store the XML-encoded contents of the license directly in app.config:
<appSettings>
  <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;" />
</appSettings>

Windows Registry

Licenses stored in a registry key named License in the following registry locations are automatically detected:

  • HKEY_LOCAL_MACHINE\Software\ParticularSoftware
  • HKEY_CURRENT_USER\Software\ParticularSoftware

To install a license as a registry key, use the following steps:

  • 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.

It is safe to ignore any warnings regarding empty strings.

Environment variable

The license can also be specified by setting the PARTICULARSOFTWARE_LICENSE environment variable containing the license text.

  • Windows
    $env:PARTICULARSOFTWARE_LICENSE = @"the license text goes here
    and is a multiline string"@
    
  • Linux/macOS
    export PARTICULARSOFTWARE_LICENSE=`cat ./license.xml`
    export PARTICULARSOFTWARE_LICENSE="the license text goes here
    and is a multiline string"
    

Sometimes the license must be embedded in a single line of text, for example, in a command line when deploying an endpoint with Docker. For these scenarios, the license can be minified, removing all spaces and line-breaks, by adding minify=true to the query string of the URL used to download a license file from the Particular Software website.

Behavior

The license is only read once at startup. When the license expires the endpoint logs will contain a message indicating the license is expired. To resolve this the endpoint must be restarted so that it can read the updated license at startup.

Troubleshooting

Diagnose license scanning issues by enabling Debug logging as all traversed locations and the scan result are logged.

2020-04-17 12:11:31.979 DEBUG Looking for license in the following locations:
License not found in S:\docs.particular.net\samples\pubsub\Core_7\Publisher\bin\Debug\net5.0\license.xml
License found in C:\Users\XXX\AppData\Local\ParticularSoftware\license.xml
License not found in C:\ProgramData\ParticularSoftware\license.xml
Selected active license from C:\Users\XXX\AppData\Local\ParticularSoftware\license.xml
License Expiration: 2021-01-01

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 by using another suitable license management technique, change permissions, or use another process that has appropriate permissions.

Related Articles