PostSharp6.6//Deployment and Configuration/Licensing/License Types/Per-Usage Licenses

Per-Usage Licenses

Unlike per-developer licenses, per-usage licenses have no limitation on the number of users that can build the projects in the repository. Instead, they limit the number of lines of code you can enhance with PostSharp.

This topic contains the following sections:

To find more about the algorithm that PostSharp uses to determine the number of lines of code enhanced by PostSharp, see Number of Enhanced Lines of Code.

Installing a per-usage license

A per-usage license can only be installed in a configuration file placed in the repository where your code is. See Deploying License Keys for instructions on how to do that.

Checking the current consumption of a per-usage license

You can check the current status of how many enhanced lines of code are being reported for your subscription on the customer portal. Sign into the portal with a license key and you'll be able to see the usage data for the last 30 days.

License allocation strategy

When PostSharp checks for licenses, it first uses any per-developer licenses that are available, before considering per-usage licenses. When all requirements of a target type are gathered, we select the cheapest license(s) that cover all the requirements. This means that if e.g. both PostSharp Ultimate and PostSharp Logging licenses are present, and a target type requires PostSharp Logging plus some other PostSharp Ultimate feature, only the PostSharp Ultimate license is consumed because it covers PostSharp Logging as well. On the other hand, if only PostSharp Logging is required by the target type, only the PostSharp Logging license is consumed.

If your code uses a feature that is not covered by any per-developer or per-usage license, PostSharp will try to consume the free allowances for premium features offered by PostSharp Community. This means that if a per-usage license is found and it satisfies the requirements of an enhanced type, it is always consumed even though the free features provided by Community Edition have not been used up yet.

License enforcement

Per-usage licenses are always enforced using license audit. Usage data is gathered on all develoment devices and uploaded once per day to our license auditing service in the cloud. The data includes a hash of the repository name, a hash of all enhanced type names, and the number of lines of code in enhanced types, as well as the license key itself.

On our servers, we aggregate the data based on the type name hashes, so that if multiple people build the same code on different devices or build different solutions which share projects, each enhanced type would only consume the licenses once. If the same type hash is reported with different numbers of lines of code, we take the higher number. If the same type has is reported to be enhanced using different sets of subscriptions, all of them are consumed.