JBickford.com

SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified

This problem was driving me crazy! Trying to work on a project in Visual Studio 2012, with my SQL Connections pointed at “(localdb)\Projects”. I would be working, refresh and the page would come to a complete halt – could not find instance.

Then I stumbled upon this helpful comment from Ward Beattie:

By default, a LocalDB instance will terminate after 5 minutes with no connections. This can be changed, as follows:

1. Connect to the instance as sysadmin.

2. Run the following batch to show advanced options:

exec sp_configure ‘show advanced options’,1

reconfigure

exec sp_configure

go

3 Run the following batch to change the timeout to 65535. This value is in seconds, but 65535 is the magic number meaning infinite:

exec sp_configure ‘user instance timeout’,65535

reconfigure

exec sp_configure ‘user instance timeout’

go

Once this is done, you will need to shut down the instance using SqlLocalDB.exe, or by connecting and using the T-SQL shutdown command. The instance will also shut down if the user that started it (and owns it) logs off.

 

Sure enough, I extended the timeout and it seems to build and run correctly again!