Failed to create an object instance for the specified ProgID (WIA.CommonDialog)

后端 未结 1 793
-上瘾入骨i
-上瘾入骨i 2021-01-20 12:00

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:

相关标签:
1条回答
  • 2021-01-20 12:24

    The MSDN reference states that to enable COM Interop inside the browser, you must

    1. Set Registry Key HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight\ (or on x64 HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Silverlight\) AllowElevatedTrustAppsInBrowser DWORD 0x0000001

    2. Check your group policy has not disabled AllowInstallOfElevatedTrustApps and AllowLaunchOfElevatedTrustApps

    3. Sign the .xap

    4. Install cert to Trusted Application Store (see screenshots illustrating how)

    Additionally, you must

    1. configure as Out of Browser Application (even if you are not running Out of Browser)

    2. before calling the ComAutomationFactory.CreateObject you should check for Application.Current.HasElevatedPermissions and AutomationFactory.IsAvailable

    3. 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

    1. Use ProcMon to verify that the AllowElevatedTrustAppsInBrowser registry key is being read

    2. Attach Debugger to Silverlight (see screenshots)

    3. MSIE Protected Mode settings can also adversely affect whether a Silverlight application can run with Elevated Permissions. Try running with different Protected Mode settings.

    0 讨论(0)
提交回复
热议问题