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

We are trying to allow users to scan documents using Silverlight XAP, which works in a highly trusted browser, from a remote server and we get the following error:

Unhandled error in Silverlight application Failed to create an instance of the object for the specified ProgID.

The failure occurs on the following line:

Dim CommonDialog = AutomationFactory.CreateObject("WIA.CommonDialog")

Application.Current.HasElevatedPermissions and AutomationFactory.IsAvailable both return True.

I can successfully create an instance of unsafe ActiveX controls, for example. Scripting.FileSystemObject:

Dim fso = AutomationFactory.CreateObject("Scripting.FileSystemObject")

Code crashes when working from a production environment on a remote server. When starting from the ASP.NET development server from the local host, the code succeeds, and when called CommonDialog.ShowAcquireImage(), the WIA scan dialog box is displayed.

How can i solve this? (Maybe something specific in the WIA that prevents him from using this method?) What steps can I take to try and debug this?

Update

When I try to open the created Silverlight test page (via the protocol file), I get the same error.

Update 2

Process Monitor shows that AllowLaunchOfElevatedTrustAppsand keys are AllowElevatedTrustAppsInBrowsersuccessfully requested.

Update 3

When protected mode is off, the code works.

+4
source share
1 answer

MSDN , COM-

  • HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight\ ( x64 HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Silverlight\) AllowElevatedTrustAppsInBrowser DWORD 0x0000001

  • , AllowInstallOfElevatedTrustApps AllowLaunchOfElevatedTrustApps

  • .xap

  • (. , , )

,

  • ProcMon AllowElevatedTrustAppsInBrowser

  • Silverlight (. )

  • MSIE , Silverlight . .

+1

All Articles