FluentConfigurationException - sqllite
Hi,
I've followed the instructions (or atleast I think I have) attempting to get fluent nhibernate setup in an asp.net mvc project using sqllite. I've attached the code for clarity, but I get a 'FluentConfigurationException' within my CreateSessionFactory Method (originating after the SchemaExport attempts to run). The innermost exception says "Unable to open database file", what is strange is I get this exception on VS2010 RC on my windows 7 machine at home, but I don't get it on my server2008 machine at work where it works as expected (VS2010 RTM). The build is set to x86 mode and I have the right sqllite dll for it I believe.
I realise this could be a sqllite issue but I thought it best to start here, does anyone know why I'm getting this issue here and how I might solve it?
Thanks
Support Staff 2 Posted by Paul Batum on 20 Apr, 2010 12:30 PM
Sorry if this is really obvious, but have you got the DB file on both of your machines? It sounds like you're not using the in-memory mode, and are instead using a file as the db storage, so of course you are going to need that file to be on your home machine as well.
3 Posted by Chris Fletcher on 20 Apr, 2010 01:05 PM
I was under the impression that the code I attached (which I cant see, I'll re-attach) would recreate the database file from scratch every time (my next step was to put together a method to insert some test data). I'm carrying the project on a usb drive anyway though so the solution is kept on the same physical disk.
Support Staff 4 Posted by Paul Batum on 25 Apr, 2010 01:45 PM
You're right, the code you are using should create the db file.
I haven't come across this error message before. Maybe its some sort of permissions problem?
I would consider writing a tiny test app that interacts with sqlite directly to create a file-backed db and then run it from your usb drive. If that works on your server2008 machine and fails on your home machine, then that tells us that its not really a nhibernate problem and more about the nature of running of the USB on win7.
5 Posted by Berryl on 06 May, 2010 04:27 AM
Hi Chris
I am guessing your home box is under 4.0 and your work box is earlier. There is a dependency in the SQLite dll on SqlData 2.0. Try putting BOTH of the below in app or web config if so
HTH,
Berryl
Support Staff 6 Posted by Paul Batum on 16 May, 2010 06:50 AM
Did you ever figure this one out Chris?
7 Posted by Joe Benckert on 03 Jul, 2010 12:26 AM
So, I had this same issue. Windows 7 - VS 2010. After struggling and googling for quite a while I decided to run VS as an administrator and all was well; definitely a permissions issue.