Change the default version of MSSqlLocalDB for Visual Studio 2015Ask Question


I am working on a C# project with SQL Server. For development, we use LocalDB instance of SQL Server. If something is changed in the database, we check-in the .mdf/.ldf files into TFS. The connection is made using MSSqlLocalDB.

The problem

After upgrades on some systems, we are now using VS 2013 and VS 2015, both for development. The issue started because of the fact that VS 2013 defaults to SQL Server 2014 and VS 2015 defaults to SQL Server 2016 for LocalDB instances.

Once the .MDF file has been opened with 2016, it becomes incompatible with 2014. Due to this, people using 2015 can't check-in the database changes.

To solve it, I installed Version 2014 of LocalDB on to machines with VS 2015 but unable to change the default version to which VS connects to.


Thanks in advance...


It took me 2 days to find the solution to this problem.

Posting here for anybody who faces the issue in future.

I basically removed all instances of LocalDB from my system and reinstalled them. Following are the steps that were required to finally solve the issue

  1. Remove all the databases attached to the LocalDB 2016
  2. Remove LocalDB 2016
  3. Remove LocalDB 2014
  4. Restart the system
  5. Reinstall LocalDB 2014

For installation of LocalDB 2014, either use the standalone file from "" OR Select Express from standard Sql Server Setup and then select LocalDB in the component list

Edit 1

I have found another user having similar problem(Link). Please see the answers there also. IMO The answer there may be preferable than mine above which involves uninstall of SqlLocalDB 2016 and that may break other applications using it.

标签: sql-server visual-studio-2015 sql-server-2014-localdb sql-server-2016-localdb
© 2014 TuiCode, Inc.