Win2003 服务器上 .Net 3.5 SP1 上的 Castle DynamicProxy2 问题
我有一个 mvc + nh asp.net 应用程序。在我的开发机器(win 7 Ent)上一切正常,如果部署在 Win 2k3 上(尝试了 2 个不同的虚拟机和一台物理机器),我收到以下错误..
有人可以帮忙吗?无法解释这个问题(尝试了相同的构建,所以我认为这是一个机器配置问题)..
从程序集“DynamicProxyGenAssembly2”中派生出“CustomerProxy75950979a2a048e889584c21696f7f1b”类型的方法“set_ID”,Version=0.0.0.0,Culture=neutral,PublicKeyToken=null ' 无法减少访问
[TypeLoadException:程序集“DynamicProxyGenAssembly2,Version=0.0.0.0,Culture=neutral,PublicKeyToken=null”类型“CustomerProxy75950979a2a048e889584c21696f7f1b”中的派生方法“set_ID”无法减少访问。] System.Reflection.Emit.TypeBuilder._TermCreateClass(Int32句柄,模块模块)+0 System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() +915 System.Reflection.Emit.TypeBuilder.CreateType() +108 Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType() +48 Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] 接口,ProxyGenerationOptions 选项)+3821 Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxy(类型classToProxy,类型[]additionalInterfacesToProxy,ProxyGenerationOptions选项)+84 Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(类型classToProxy,类型[]additionalInterfacesToProxy,ProxyGenerationOptions选项,Object[]构造函数参数,IInterceptor[]拦截器)+92 Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] extraInterfacesToProxy, IInterceptor[] 拦截器) +21 NHibernate.ByteCode.Castle.ProxyFactory.GetProxy(对象id,ISessionImplementor会话)+283
I've an mvc + nh asp.net application. On my dev machine (win 7 Ent) all works fine, if deployed on a Win 2k3 (tried 2 different vm and one phisical machine) I got the following error..
anyone can help? Cannot explain this issue (tried the same build, so i think it'a machine configuration issue)..
Derived method 'set_ID' in type 'CustomerProxy75950979a2a048e889584c21696f7f1b' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' cannot reduce access
[TypeLoadException: Derived method 'set_ID' in type 'CustomerProxy75950979a2a048e889584c21696f7f1b' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' cannot reduce access.]
System.Reflection.Emit.TypeBuilder._TermCreateClass(Int32 handle, Module module) +0
System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() +915
System.Reflection.Emit.TypeBuilder.CreateType() +108
Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType() +48
Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options) +3821
Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options) +84
Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors) +92
Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, IInterceptor[] interceptors) +21
NHibernate.ByteCode.Castle.ProxyFactory.GetProxy(Object id, ISessionImplementor session) +283
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发现了问题。我的派生类中有一个重复的属性(与使用模板定义的基类相同)。
found the issue. I had a duplicate property in my derived class (same as the base class defined with a template).
刚刚遇到了这个错误,这个问题再次出现在我的派生类中具有重复的 id 属性。
just had this error, and again this issue was having a duplicate property of id in my derived classes.