I ran into the same problem: Model First approach in mvc4 using EF5. What I did was create a project, add a new model, add entities and associations on the edmx diagram. Right-click on the chart and select "Generate Database from Model". This creates a sql file.
Now add the mdf file, say Database1.mdf (Add> New Item> Data> SQL Server Database) in the App_Data folder in Solution Explorer.
Right click> Open mdf in this file. Now in the properties area you have a connection string. Just copy it as it is.
Go back to the created SQL script, right click> Exeecute. A popup window asks for connection settings. Make sure you have the correct value in the server name (use the name of your PC or 127.0.0.1).
Now in the settings go to the tab "Advanced connection settings" and paste the connection string copied from the properties of the mdf file.
It worked perfectly for me and is quite logical. There is no need to interact directly with the SQL Server installation directory.
Zeeshan
source share