System.MethodAccessException仅在winhost服务器上。致力于发展

时间:2011-07-27 21:29:28

标签: vb.net exception data-binding repeater live

Attempt by method 'Microsoft.VisualBasic.CompilerServices.Symbols+Container.InvokeMethod(Method, System.Object[], Boolean[], System.Reflection.BindingFlags)' to access method 'System.Data.Objects.MaterializedDataRecord.get_Item(System.String)'失败了。

当我在winhost服务器上运行时,我收到此System.MethodAccessException错误。当我运行内置vs它工作正常。无论我在哪里使用

,似乎都会发生
 <%# Container.DataItem("Something")%>

任何建议都会很棒。感谢。

1 个答案:

答案 0 :(得分:2)

在您的web.config文件中启用完全信任:

<configuration>
<system.web>
<trust level="Full" />
</system.web>
</configuration>