I'm working on a system to use a SqlServerCe with NHibernate. From my driver program, if I add the System.Data.SqlServerCe assembly as a reference, I can create and run queries against a database just fine. When trying to use NHibernate, though, I get the following exception:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll Additional information: Could not load file or assembly 'System.Data.SqlServerCe' or one of its dependencies. The system cannot find the file specified.
I've traced the exception to a call to Assembly.Load("System.Data.SqlServerCe"), which seems like it should work. The System.Data.SqlServerCe assembly is in the GAC (I've also tried to add it as a local reference with CopyLocal=true, to no avail), and I can use its members fine, so why can't I explicitly load it? When I open the assembly in Reflector, it has trouble loading the System.Transactions reference (I've also tried adding it as a local reference, again to no avail), so loading that assembly might be the problem, rather than the System.Data.SqlServerCe assembly.
Is this a common problem? System misconfiguration, maybe?