Problem with spring + nhibernate in .net environment
I am working with Spring.net 1.3 and nHibernate for .net 1.3. While fetching the ap开发者_高级运维plication context using XML ( _appContext = new XmlApplicationContext("abc.xml")) I am getting the exception as "Error creating object with name 'NHibernateSessionFactory' defined in abc.xml" Initialization of object failed : The following types may not be used as proxies"
I have declared all the properties of class as public virtual.still why am i getting this exception
Thanks in advance
You must have missed marking a property or method virtual. The exception (or an InnerException, I'm not familiar with Spring) message should tell you exactly which type is the problem. For example, I just reproduced this:
{"The following types may not be used as proxies:\nModel.Project: method get_ProjectId should be 'public/protected virtual' or 'protected internal virtual'"}
精彩评论