Question: I need to attach an MDF file to the LocalDB. How to do it? In this case, I lost the EPiServer LocalDB connection and hence could not publish my EPiServer 8 site properly to my test server. It failed with a database connection error – I tried to solve this issue by making changes to the target database server, not realizing that the problem was the LocalDB database on my laptop, trying to publish the EPiServer database to the target SQL Server.
How to do it:
In Visual Studio, go to Server Explorer => Data Connections => Add data connection
Browse / select the correct MDF file and give the database a friendly Logical Name.
Click OK, and there you go, you can find the attached database in the Server Explorer..