FIXED: "Invalid type owner for DynamicMethod" error in Nhibernate
If you recieve the "Invalid type owner for DynamicMethod" error while initializing you NHibernate SessionFactory then it's pretty likely that you are using generic methods on some of your lazy loaded/proxied classes.
Nhibernate incorporates a reflection optimization that speeds up the creation of proxy classes. This reflection optimization does not play well with generics. The error it throws is "Invalid type owner for DynamicMethod". Not very friendly.
So, to fix this you must either stop using generic methods OR turn off the optimization. To turn off the optimization you must run the following code before you initialize your SessionFactory.
Nhibernate incorporates a reflection optimization that speeds up the creation of proxy classes. This reflection optimization does not play well with generics. The error it throws is "Invalid type owner for DynamicMethod". Not very friendly.
So, to fix this you must either stop using generic methods OR turn off the optimization. To turn off the optimization you must run the following code before you initialize your SessionFactory.
NHibernate.Cfg.Environment.UseReflectionOptimizer = false;
Comments
Rochester Hills
uwatchfree
filmy4wep
jaa lifestyle login
lay on hands dnd 5e
It sounds like you've run into a tricky situation with Nhibernate. The "Invalid type owner for DynamicMethod" error can be a difficult one to debug. Fortunately, there are some good resources out there that can help you troubleshoot the issue. It is important to make sure that you are using the correct type for the owner when creating a dynamic method. If you are still having trouble, it may be best to reach out to an experienced Nhibernate user for advice.