Hi all. I am a Java developer turned .NET developer, and I've got some
small projects that use LINQ to SQL that I'm considering switching
over to user NHibernate. (LINQ to SQL frustrates me. I spend lots of
time trying to figure out what how to write my business logic in such
a way that it doesn't depend on LINQ to SQL's oddities.) Anyway, I put
together a simple example to try most of the things I do with LINQ to
SQL to see if I can use NHibernate, and I'm impressed, but I ran into
an issue.
I posted this question on the NHibernate Users forum on the Hibernate
site, but got no reply for a few weeks. The post there is
https://forum.hibernate.org/viewtopic.php?f=25&t=1009470, and it
includes the code I used. The short version is that this:
IList<Cat> dbCats = session.Query<Cat>().Where(cat => cat.Toys.Any(t
=> t.Shape == "Bird")).ToList();
gets me this:
Could not load type cat.Toys. Possible cause: the assembly was not
loaded or not specified.
I've since downloaded the NHibernate source and compiled it with
debugging turned on using .NET 3.5. The exception occurs at
NHibernate.Util.ReflectHelper.ClassForFullName(String classFullName)
in path\to\\NHibernate-3.0.0.GA-src\src\NHibernate\Util
\ReflectHelper.cs:line 222.
Am I not understanding how this is supposed to work? This is the last
thing preventing me from switching over my new project and eventually
porting over some older projects, as well.
Thanks!