We recently upgraded our Automapped FNH / NH project to NH 3.2 and faced many problems.
We have many properties in our object model that have only a "getter", for example
public virtual float Polydispersity { get { return MeasurementRun.PolyDispersity; } }
This works well, but now we get the error "Could not find setter for property."
It was hard to find, because for some reason automatic creation without the slightest glitches did not create database tables, which led to "no persister" errors when saving to the database - see this for details.
Is it because LinFu is now built into NH? I know that private setters no longer work, and this seems like a similar problem.
We used to use Castle, and I really like that NH doesn’t require all these DLLs now, but not if it crashes most of our object model.
Any suggestions on how to get around this?
Stack trace
FluentNHibernate.Cfg.FluentConfigurationException: Invalid or incomplete configuration was used to create the SessionFactory. See the PotentialReasons and InnerException collection for more information.
---> NHibernate.PropertyNotFoundException: could not find an installer for the "Polydispersity" property in the "BI_OverlordDlsAppCore.OfeDlsMeasurement" class in NHibernate.Properties.BasicPropertyAccessor.GetSetter (Type Type, String propertyName) in Type_Property.Mapping.Mapping ) in NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildPropertySetter (property mappedProperty, PersistentClass mappedEntity) at NHibernate.Tuple.Entity.AbstractEntityTuplizer..ctor (entityMetamodel entityMetamodel, PersistentClass mappingInfo) in NHibernate.Tuple.Entity.PocoEntityTuplizer..ctor (entityMetamodel entityMetamodel , Persistentclass ntity.AbstractEntityPersister..ctor (PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory) in NHibernate.Persister.Entity.JoinedSubclassEntityPersister..ctor (PersistentClass persistentClass, ICacheConcurrencySteryClass class model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) in NHibernate.Impl.SessionFactoryImpl..ctor (cfg configuration, IMapping mapping, Settings, EventListeners listeners) on NHibernate.Cfg.Configuration.BuildSessionFactory () atFluentCentfentConfluentonfluentfenthentfentnentfentfentfentfentfentfentfentfentfentconentluentfluconfluentfentnentfluconfluentfentconentluentfluconfluentfentonentfuentonentfuentonentfuentonentfuentonentfuentonentluentfluconfluntonfluenthonfluentonfluenthonfluconfluentfluenthonfluentonfluenthonfluenthonfluentfentonentfuentonentfuentonentfuentonentfuentonentfuentonentfuentonentfuentonentfuentonentfluon () --- The end of the internal trace of the FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory () exception stack in BI_OverlordPackageCore.OfeDatabase .CreateSqliteSessionFactory () in C: \ Bicw_Dev \ Bic.Net \ Private Projects \ NHibernate \ FNH 1.3 Mapping Error \ OfeDatabase.cs: line 192 in BI_OverlordPackageCore.OfeDatabase.GetMainSession () in C: \ Bicw_Dev \ Bicw_Dev \ Bicw_Dev \ Bicw_Dev \ Bicw_Dev \ BicwNet \ NHibernate \ FNH 1.3 Mapping Error \ OfeDatabase.cs: line 147 in BI_OverlordPackageCore.OfeDatabase.Initialize (assembly [] assemblies) in C: \ Bicw_Dev \ Bic.Net \ Private Projects \ NHibernate \ FNH 1.3 Mapping Error \ OfeDatabase.cs: line 305 on FNH_1._3_Mapping_Bug.Form1.button1_Click (object sender, EventArgs e) in C: \ Bicw_Dev \ Bic.Net \ Private projects \ NHibernate \ FNH 1.3 Mapping Error \ Form1.cs: line 23 in System.Windows.Forms. Control.OnClick (EventArgs e) in System.Windows.Forms.Button.OnClick (EventArgs e) in System.Windows.Forms.Button.OnMouseUp (MouseEvent Args mevent) in System.Windows.Forms.Control.WmMouseUp (Message & m, MouseButtons, Int32 clicks). System.Windows.Forms.Control.WndProc (Message & m) in System.Windows.Forms.ButtonBase.WndProc (Message & m) in System.Windows.Forms.Button.WndProc (Message & m) in System.Windows.Forms .Control.ControlNativeWindow.OnMessage (Message & m) in System.Windows.Forms.Control.ControlNativeWindow.WndProc (Message & m) in System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtrpa )