We are trying to allow users to scan documents using a Silverlight XAP running in-browser with elevated trust, from a remote server, and are getting the following error:
The MSDN reference states that to enable COM Interop inside the browser, you must
Set Registry Key HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight\
(or on x64 HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Silverlight\
) AllowElevatedTrustAppsInBrowser DWORD
0x0000001
Check your group policy has not disabled AllowInstallOfElevatedTrustApps
and AllowLaunchOfElevatedTrustApps
Sign the .xap
Install cert to Trusted Application Store (see screenshots illustrating how)
Additionally, you must
configure as Out of Browser Application (even if you are not running Out of Browser)
before calling the ComAutomationFactory.CreateObject
you should check for Application.Current.HasElevatedPermissions and AutomationFactory.IsAvailable
note that Elevated Permission testing from http://localhost and http://127.0.0.1 is not reliable test, as Silverlight runtime makes exception for these two URLs. Instead use file://
.
Troubleshooting
Use ProcMon to verify that the AllowElevatedTrustAppsInBrowser
registry key is being read
Attach Debugger to Silverlight (see screenshots)
MSIE Protected Mode settings can also adversely affect whether a Silverlight application can run with Elevated Permissions. Try running with different Protected Mode settings.