我正在编写一个小型的iframe托管的XBAP,它需要与主页交互。我首先写了一个小POC,看看我所需要的一切都是可能的。
下面是页面构造函数的代码:
Public Sub New()
' This call is required by the designer.
InitializeComponent()
Try
Dim scriptObject = BrowserInteropHelper.HostScript
scriptObject.alert("blablabla")
Catch ex As Exception
MessageBox.Show(ex.ToString(), "Sign error", MessageBoxButton.OK, MessageBoxImage.Error)
End Try
End Sub"alert“行抛出下一个异常:
System.TypeAccessException: Attempt by method 'DynamicClass.CallSite.Target(System.Runtime.CompilerServices.Closure, System.Runtime.CompilerServices.CallSite, System.Object, System.Object ByRef)' to access type 'System.Runtime.CompilerServices.CallSite`1<Microsoft.VisualBasic.CompilerServices.IDOUtils+SiteDelegate1>' failed.
at CallSite.Target(Closure , CallSite , Object , Object& )
at Microsoft.VisualBasic.CompilerServices.IDOUtils.CreateRefCallSiteAndInvoke(CallSiteBinder Action, Object Instance, Object[] Arguments)
at Microsoft.VisualBasic.CompilerServices.IDOBinder.IDOCall(IDynamicMetaObjectProvider Instance, String MemberName, Object[] Arguments, String[] ArgumentNames, Boolean[] CopyBack, Boolean IgnoreReturn)
at SignVerify.Web.XBAP.Page1..ctor()这在64位IE中会发生,使用32位IE时,整个XBAP都无法加载(甚至在警告行之前)。
感谢分配!
发布于 2012-03-19 18:47:06
OKay我已经明白我的错误了
应该将应用程序标记为完全信任,这样它就可以完美地工作。
https://stackoverflow.com/questions/9759835
复制相似问题