This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- FlexNet Embedded
- :
- FlexNet Embedded Knowledge Base
- :
- Cannot acquire license from trusted storage after restart
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Cannot acquire license from trusted storage after restart
Cannot acquire license from trusted storage after restart
Summary
Cannot acquire license from trusted storage after restartQuestion
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()?
No ratings