I was trying the ASP.Net MVC 4 tutorial. When I have added the following code and build the application I was expecting Movies.mdf file will be created under App_Data folder on the Solution Explorer. However, nothing has been created in that directory. Any idea why?
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MvcMovie-2012213181139;Integrated Security=true"
providerName="System.Data.SqlClient"/>
<add name="MovieDBContext"
connectionString="Data Source= (LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Using:
.NET Framework 4
VS 2010
The problem is solved. The problem was the location of the project. I was working with the files from a shared drive which apparently did not create the database in the App_Data folder. Connectionstring code is absolutely fine as it is shown in the tutorial and no changes are required.