Given: Code First Technique (all properly done and validated). I can actually, in the application see records added from the program. This means all the SaveChanges and subsequent queries are working.
Problem: I want to expose this DB to another program but cannot get Server Explorer Data Connections to attach to it...
What did you try?
In VS2013 I opened the Server Explorer, clicked on Add Connetion and entered this (after changing the DataSource to SQLClient and not the default database file setting) : (LocalDb)\V11.0 and then clicked on "Selected or enter a database name" The tables shown did not show the new database table.
I then tried to type in the fully qualified name of MYProject.MYDBContent and that didn't work.
I then switched to the checkbox of "Attach a database file" and found the file that was created. (Yes!) But when attempting to open it says It cannot be opened because it is version 782, this server supports version 706 and earlier. Later on, the message says also "A database with the same name exists, or specified file cannot be opened, or it is located on a UNC Share."
Environment
I'm using VS2013 and used NUGET to download EF 6.0.2, but when I look at EF in the references area is tells me it's still Version 4.0....
My system has both SQL Server 2012 and 2014 (Local DB) installed. This must be root cause of issue.
Thoughts?
Visual Studio 2013, EF 6.0.1 and SQL Express 2012 do not work well together when using Code First. The problem is the MDF file is generated but any attempt to connect using the Server Explorer Data Connections fails with the 782 error message above as well as in SSMS for SQL 2012. Even if your system does not have SQL 2014 installed the MDF file version thinks it is a 2014 file version!
If you delete an MDF file (as I did and subsequent) attempts to create MDF fail (Cannot Attach File error), then simply rename the DBContext class name and you will get a new MDF file!
Environment:


