I have an ASP.Net 4.0 website which uses SQL Server CE and EF code-first for its data store. When 2 or more users are on the site I intermittently get the following exception about every 5th or 6th time.
There is a file sharing violation. A different process might be using the file. [D:\directory...\file.sdf].
Throughout the code I create, use, and promptly dispose of the DbContext
each time one is needed. Even though it is the default, I have added File Mode = Read Write
to the connection string.
Any ideas what I might be doing wrong.