You've got your collection properties as the concrete List(Of T), instead of the interface IList(Of T). Try changing that and see what happens; NHibernate dynamically subclasses IList to provide it's own implementation for lazy loading (the PersistentGenericBag you're getting in your exception), and it can't cast between that implementation and the concrete List(Of T).
On Tue, Feb 16, 2010 at 3:07 PM, bender.oh <bender...@googlemail.com> wrote: > I am attempting to convert the example FirstProject to VB. > > I have completed all the entity mappings and DB configuration code. > However, when I attempt to save a single product with a store I get > nHibernate.Property.AccessException > {"Invalid Cast (check your mapping for property type mismatches); > setter of FluentVB.Store"} > > InnerException > {"Unable to cast object of type > 'NHibernate.Collection.Generic.PersistentGenericBag`1[FluentVB.Product]' > to type 'System.Collections.Generic.List`1[FluentVB.Product]'."} > > I have saved my project (14kb) on google docs at > > http://docs.google.com/leaf?id=0B6nX6hIcjaNyNTI5YmMzMGItOGU4OC00NjJmLTkzMjktMGM5MmY2YTk1NjBm&hl=en > This has none of the dlls included. > > I realise the problem is something simple, but I can't even get a > simple One-to-Many project to work without getting the same faliure. > > Any help would be appreciated. > > -- > You received this message because you are subscribed to the Google Groups > "Fluent NHibernate" group. > To post to this group, send email to fluent-nhibern...@googlegroups.com. > To unsubscribe from this group, send email to > fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/fluent-nhibernate?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibern...@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.