Wcf AuthenticationBase上的MethodAccessException<;用户>;。UpdateUser异常

Wcf AuthenticationBase上的MethodAccessException<;用户>;。UpdateUser异常,wcf,service,ria,Wcf,Service,Ria,我正在对安装程序安装的System.ServiceModel.DomainServices.Server程序集中的AuthenticationBase类调用UpdateUser。这在我的Win 7台式机上有效,但在我的Win 7笔记本电脑上,我得到以下例外 关于我应该寻找什么,或者如何确定这两个系统之间的区别,有什么想法吗?谢谢 System.MethodAccessException was unhandled Message=Attempt by method 'System.S

我正在对安装程序安装的System.ServiceModel.DomainServices.Server程序集中的AuthenticationBase类调用UpdateUser。这在我的Win 7台式机上有效,但在我的Win 7笔记本电脑上,我得到以下例外

关于我应该寻找什么,或者如何确定这两个系统之间的区别,有什么想法吗?谢谢

System.MethodAccessException was unhandled
      Message=Attempt by method 'System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1<T>.IsReadOnly(System.Reflection.PropertyInfo)' to access method 'System.Linq.Enumerable.Cast<System.ComponentModel.DataAnnotations.EditableAttribute>(System.Collections.IEnumerable)' failed.
      Source=System.ServiceModel.DomainServices.Server
      StackTrace:
           at System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.IsReadOnly(PropertyInfo propertyInfo)
           at System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.UpdateProfile(T user)
           at System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.UpdateUserCore(T user)
           at System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.UpdateUser(T user)
System.MethodAccessException未处理
Message=方法'System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase'1.IsReadOnly(System.Reflection.PropertyInfo)'尝试访问方法'System.Linq.Enumerable.Cast(System.Collections.IEnumerable)'失败。
Source=System.ServiceModel.DomainServices.Server
堆栈跟踪:
位于System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.IsReadOnly(PropertyInfo PropertyInfo)
位于System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.UpdateProfile(T用户)
位于System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.UpdateUserCore(T用户)
位于System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase`1.UpdateUser(T用户)

听起来您对笔记本电脑实例没有反射权限

您是否正在另一个用户帐户下运行它

看一看这张照片


另外,请确保两者都运行相同版本的.NET,因为.NET 4中引入了安全更改。

是。都是本地账户。如何确定用户是否具有反射权限?您必须使用
ReflectionPermission.Demand()
。用更多信息更新答案。我不知道怎么做。我一直在寻找线索,但没有找到。权限是在被调用的程序集上还是在调用代码的客户端程序集上?