PostSharp 6.5 / / Post­Sharp Documentation / Deployment and Configuration / Licensing / Using Post­Sharp License Server

Using PostSharp License Server

If the license audit is not acceptable in your company for regulatory or other reasons, you can consider using the PostSharp License Server.

PostSharp License Server is a server application that customers can install into on their own premises to measure the number of concurrent users of PostSharp. The application is based on ASP.NET and Microsoft SQL Server.

This topic contains the following sections:

If you are a system administrator or license administrator, see also Installing and Servicing PostSharp License Server.


Using the license server is optional. Only a few enterprise customers chose to use it. Alternative approaches are:

  • To rely on the default license audit mechanism (see License Audit for details).

  • To acquire enough licenses for the whole team with some reserve margin.

  • To use a spreadsheet to keep track of who is using the software.

  • To use other software audit products, although this approach is imperfect because PostSharp is not installed on the developer's machine as a standalone and indentifiable application.

Design Principles

The license server manages leases of a license to a given user on a given machine (the “client”). Once the lease is provided to the client, it is cached on the client. Upon client request, the server will return a license key and two dates: the lease end date and the lease renewal date. The lengths of the lease and of the renewal period are configurable. The client will not contact the license server before the renewal date, so the client can go offline during the duration of the lease. Then, a new lease will be reserved for the client. If the client is not able to renew its lease from the server after the lease renewal date, the client will still be able to use PostSharp until the end of the lease. Then, the use of PostSharp will be prevented. To avoid loss of productivity due to lack of network connection or server outages, we recommend setting a large delay between the lease renewal period and the lease period.

If the number of concurrent users exceeds the licensed number, the license administrator will receive an email, and additional users will be allowed during a grace period. At the end of the grace period, only the licensed number of concurrent users will be allowed. The duration of the grace period and the number of excess users depend on the kind of license. By default, it is set to 30% of users and 30 days.

Important note Important

If you have subscribed to a license server, you will need periodic connections to the company network. The licensing client will automatically try to renew a lease when it comes close to expiration and if the license server is available. Lease duration and renewal settings can be configured by the administrator of the license server. A connection to the license server is not necessary while the lease is valid.

Subscribing to the license server

If your company uses PostSharp License Server, you can register using a similar procedure as for registering a license key:

To subscribe to a license server using the user interface:

  1. Open Visual Studio.

  2. Click on menu PostSharp, then Options.

  3. Open the License option page.

  4. Click on the Subscribe to a license server link.

    License Server 5
  5. Paste the URL of the license server. You can click on the Open hyperlink to verify that the URL is correct and that you have access to it. Click Next.

    License Server 6
  6. Read the license agreement and check the option I accept. Click on Next.

    License Server 7
    Tip Tip

    If you are registering the license server on a build server, also check the option Register the license for all accounts on this machine.

  7. You are done.

    License Server 8
Installing the license settings in your source control

It is possible to subscribe to the license server using a file stored in your source control system by using the exact same mechanism as to register a license key.

To install license settings in your source control system:

  1. Create a file named postsharp.config in the root directory of your source repository, or in any parent directory of the Visual Studio project file (*.csproj or *.vbproj).

  2. Add the following content to the postsharp.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <Project xmlns="" x:xmlns="">
      <License Value="http://server/path"/>

    In this code, http://server/path must be replaced by the URL to the license server.

See Configuring Projects Using postsharp.config for details about this configuration file.

See Also