我在AuthenticationBase上调用WCF RIA Services安装程序安装的System.ServiceModel.DomainServices.Server程序集中的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)发布于 2010-09-09 14:23:42
听起来您没有对笔记本电脑实例的反射权限。
您是否正在使用另一个用户帐户运行它?
看一看MethodAccessException docs。
此外,请确保两者运行的.NET版本相同,因为.NET 4中引入了安全更改。
https://stackoverflow.com/questions/3674240
复制相似问题