Wednesday, July 14, 2010

Could not create the driver from NHibernate.Driver.SqlServerCeDriver

Using Fluent NHibernate and MsSqlCeConfiguration, I wanted to use an SQL Compact DB for my Database by changing the FluentConfiguration but I started getting the errors from the InnerException.

"Could not create the driver from NHibernate.Driver.SqlServerCeDriver"

The fix is simples,

You need to add a reference to


Located in

"C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Desktop\System.Data.SqlServerCe.dll"

If you don't have it, you'll need to install it from.

Once you've added it you need to set the

"Copy Local" to true.

Then you should be good to go.


  1. Thanks... you saved my bacon today.

  2. No problem! :) Glad it helped someone else.

  3. Thanks. I already had a reference to System.Data.SqlServerCe, but it was the .NET 4.0 version. I added this to my config to fix it.

  4. Your small post saved me big

  5. Thanks! Worked like a charm!

  6. Thanks, It is what I was looking.