title: ASP.NET MVC4 Code First - 'Cannot attach the file as database' exception
body: <p>I'm using Code First concept in Entity Framework and I'm constantly getting the following exception while starting application:</p>
  
  <pre><code>Cannot attach the file 'C:\Users\Admin\Documents\Visual Studio 2012\
  Projects\Pro\Pro.Web\App_Data\Pro.mdf' as database 'Pro'.
  </code></pre>
  
  <p>I've put this in <code>Global.asax.cs</code> but also without success:</p>
  
  <pre><code>Database.SetInitializer(new DropCreateDatabaseIfModelChanges&lt;ProWebContext&gt;());
          var ctx = new ProWebContext();
          ctx.Database.Initialize(true);
  </code></pre>
  
  <p>I've checked under App_Data directory and there no database created. Also, under Server Explorer there is nothing under Data Connections. Everything was working fine yesterday and today not working at all. I've tried to connect to LocalDB with SQL Server Management studio but it says it cannot connect to local database. Any ideas what could be a problem?</p>
  
  <p>Thanks!</p>