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
set registry key
hkey_local_machine\software\microsoft\silverlight\
(or on x64hkey_local_machine\software\wow6432node\microsoft\silverlight\
) allowelevatedtrustappsinbrowserdword
0x0000001
check group policy has not disabled
allowinstallofelevatedtrustapps
,allowlaunchofelevatedtrustapps
sign .xap
install cert trusted application store (see screenshots illustrating how)
additionally, must
configure out of browser application (even if not running out of browser)
before calling
comautomationfactory.createobject
should checkapplication.current.haselevatedpermissions
,automationfactory.isavailable
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
use procmon verify
allowelevatedtrustappsinbrowser
registry key being readattach debugger silverlight (see screenshots)
msie protected mode settings can adversely affect whether silverlight application can run elevated permissions. try running different protected mode settings.
Comments
Post a Comment