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


we trying allow users scan documents using silverlight xap running in-browser elevated trust, remote server, , getting following error:

unhandled error in silverlight application failed create object instance specified progid.

the failure @ following line:

dim commondialog = automationfactory.createobject("wia.commondialog") 

application.current.haselevatedpermissions , automationfactory.isavailable both return true.

i can create instance of unsafe activex controls, e.g. scripting.filesystemobject:

dim fso = automationfactory.createobject("scripting.filesystemobject") 

the code fails when running production environment on remote server. when running asp.net development server localhost, code succeeds, , wia scanning dialog shown when calling commondialog.showacquireimage().

how can resolve this? (is there perhaps specific wia prevents being used way?) steps can take try , debug this?

update

when try open generated silverlight test page (via file protocol), same error.

update 2

process monitor shows allowlaunchofelevatedtrustapps , allowelevatedtrustappsinbrowser keys being queried.

update 3

with protected mode turned off, code works.

the msdn reference states enable com interop inside browser, 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 group policy has not disabled allowinstallofelevatedtrustapps , allowlaunchofelevatedtrustapps

  3. sign .xap

  4. install cert trusted application store (see screenshots illustrating how)

additionally, must

  1. configure out of browser application (even if not running out of browser)

  2. before calling comautomationfactory.createobject should check application.current.haselevatedpermissions , automationfactory.isavailable

  3. note elevated permission testing http://localhost , http://127.0.0.1 not reliable test, silverlight runtime makes exception these 2 urls. instead use file://.

troubleshooting

  1. use procmon verify allowelevatedtrustappsinbrowser registry key being read

  2. attach debugger silverlight (see screenshots)

  3. msie protected mode settings can adversely affect whether silverlight application can run elevated permissions. try running different protected mode settings.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -