Slps.Licensing.StorageAccessCouldBeVirtualised Exception thrown by VerifyInstalled() method (FAQ121)

I'm getting the following exception when the installer VerifyInstalled() method is called on the application startup:

Slps.Licensing.StorageAccessCouldBeVirtualizedException: Licensing storage could be virtualized per user as this Application does not have an Application Manifest resource with a requestedExecutionLevel specified. To resolve this issue, please add an Application Manifest resource with a requestedExecutionLevel. To inhibit reporting of this problem, pass RuntimeInstaller.OptionsEnum.PermitRegistryVirtualization to PermutationInstallerBase's constructor prior to calling VerifyInstalled() to ignore the error.

What does this exception mean?

 

This exception is being thrown because, due to the absence of an application manifest, the licensing runtime has detected that registry access is being virtualized due to UAC virtualization (see http://en.wikipedia.org/wiki/User_Account_Control).

Proceeding could mean that registry reads/writes may get diverted to a per-user store rather than the machine level store. This can lead to a variety of confusing behaviour (e.g. works for one user but not another, license administrator doesn’t show license but app does find it etc.)

[Note that this warning is not about the runtime installation necessarily having succeeded or failed - merely that, if the app is running with UAC virtualization, attempts to read/write the registry may actually be accessing shadowed versions of the license data.]

The recommended (and generally by far the easiest) solution to this is to add an UAC manifest to your app -  especially as this is required for Windows Logo Certification in any case.

To do this in Visual Studio, navigate to Project|Add Components and select Application Manifest File. Set the requestedExecutionLevel as required for your application (elevated permission are not required by the Runtime once installed). (In cases where you have a .manifest file in your project but it'snot being picked up, this can be due to Project|<ProjectName>Proerties, Application tab, Resources group, Icon and manifest's Manifest dropdown having an incorrect selection)

Please note that older versions of the Runtime (3.0.1907.390 and earlier) may display different messages for the same exception.  In those circumstances one should upgrade to the latest Code Protector/Runtime version.

Link to this

FAQ121

You can link to this item directly, using the shorter URL support.inishtech.com/FAQ121.