| Severity | Error or Warning |
| Reported by | PostSharp |
| Message | License server error: <Reason> |
Cause
When the PostSharpLicense MSBuild property or environment variable, a License element of a postsharp.config file, or a registration on the machine gives the URL of a PostSharp License Server instead of a license key, PostSharp asks this server for a lease: a license key allocated to the current user on the current machine for a limited period. PostSharp keeps the lease and asks the server again only when the lease is due for renewal. See Installing and Servicing PostSharp License Server for how leases work.
PostSharp reports PS0148 when the server does not lease a license. <Reason> names the server and says what went wrong, for example:
- The server cannot be reached, or does not answer in time.
- The server refuses to grant a lease, for example because all its licenses are in use or because the current user is not allowed to borrow one.
- The server returns a response that is not a valid lease.
- The server returns a lease that already ended. This usually means that the clock of the server is wrong.
- The license key that the server leases cannot be leased through a license server.
The licensing services decide whether the message is an error or a warning. When only the renewal of a lease fails, PostSharp can still use the lease until it ends.
This message depends on a license server and on its state, so no example can show it.
Resolution
- Open the URL of the license server in a web browser, from the machine that runs the build, to check that the server is reachable and that your account is allowed to borrow a license. Installing and Servicing PostSharp License Server describes how to test the server with the
Lease.ashxpage. - Check the network connection to the company network, for example the VPN.
- When the server refuses the lease, ask the administrator of the license server whether a license is available, and whether the lease of a former user or machine must be canceled.
- When the server returns a lease that already ended, ask the administrator to correct the clock of the server.
- On a build agent, use a license key instead of the URL of a license server: an unattended build does not request a lease. See Using PostSharp on a Build Server.
To follow what PostSharp does with the license server, capture the licensing trace with the PostSharpTrace MSBuild property, as License Troubleshooting describes.
See Also
Other Resources
Installing and Servicing PostSharp License Server
Deploying License Keys
License Troubleshooting
Using PostSharp on a Build Server