The error states to go to http://go.microsoft.com/fwlink/?Linkid=125883. When going to this URL, the URL now redirects to https://www.microsoft.com/en-us/server-cloud/products/sql-server/. The new URL do not seems to have obvious instructions on how to get Microsoft SQL Server Data Tools. Follow these directions to fix error Connections to SQL Server database files (.mdf) require LocalDB or SQL Server Express in Visual Studio.
- In Visual Studio, select Tools > Extensions and Updates
- In the Extensions and Updates pop-up box, select Installed > Updates
- Highlight Microsoft SQL Server Update for database... and click the Update button
- Your default Web browser will prompt a download of SSDTSetup.exe. If Microsoft SQL Server Update for database... is not listed, you can download SSDTSetup.exe from https://msdn.microsoft.com/en-us/mt186501.
- In your Downloads folder, run SSDTSetup
- Follow the prompts of the installer
After doing this, just to play it safe, I restarted Visual Studio. This might not be necessary. I then did the following in Visual Studio.
- In Visual Studio, if you do not already have a folder named App_Data, in the Solution Explorer panel, right-click the name of your site and select Add > New Folder. Name the new folder App_Data.
- With the App_Data folder highlighted, press Ctrl + Shift + A (or right-click and select Add > New Item)
- In the Add New Item pop-up box, select Visual Basic or C# > Data > SQL Server Database. Click Add.
The error should not appear, and in Solution Explorer should now be a file named database1.mdf.