cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot acquire license from trusted storage after restart

Cannot acquire license from trusted storage after restart

Summary

Cannot acquire license from trusted storage after restart

Question

When using the FNE 2015 R2 .NET XT kit (though this would apply to any kit really), you're having an issue with your network license implementation:

? User connects to a network license server, licenses are requested, stored in trusted storage and acquired successfully from trusted storage.

? User closes app and restarts, on launch they check trusted storage for features they've already leased from the server, using "ILicensing.LicenseManager.GetFeatureCollection(LicenseSourceOption.TrustedStorage, true);"

? This call returns a collection of their features from the last session indicating valid for acquisition.

? Realizing you have the features available for acquisition, you don't make a new request to the server.

? You then attempt to acquire licenses for the features using "ILicensing.LicenseManager.Acquire();"

? You receive the following error message:
A service system error was encountered: Requested feature was not found. [1,7E0,8,0[7000000B,0,702C7]]

So, why are you unable to acquire this feature that claims to be available for acquisition? And the really weird part is, if they make a new request to the server for the features, then try to acquire, it works fine. what?s going on here?

Answer

The problem is you are failing to add trusted storage as a license source before requesting the feature.

When a capability response is processed, trusted storage is automatically added as a license source (as indicated in the API documentation).

?A trusted storage license source for the target server instance will be added to the license source collection if not already present.?

When the application restarts the license source collection is empty and the?

"ILicensing.LicenseManager.GetFeatureCollection(LicenseSourceOption.TrustedStorage, true);"

?API will return a feature collection of the features contained in trusted storage but will not add trusted storage as a license source for feature acquisition. In fact, the GetFeatureCollection method call as you coded with the diagnostic parameter set to ?true? will return all trusted storage features both valid and invalid (i.e. expired etc.).

To fix this, on restart, you need to explicitly add trusted storage as a license source before attempting to acquire the valid features contained within trusted storage.

?ILicensing.LicenseManager.AddTrustedStorageLicenseSource()?
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Nov 12, 2018 08:54 PM
Updated by: