I am about to shoot myself. Spent few weeks now trying to solve this issue. We have an ASP.NET MVC 4 web app that uses SQL Server 2012 and Entity Framework as ORM and Unity
I had the same error for 2 days! and didn't even know why it suddenly happened?!!
What it turned out to be: I had a Network Authentication Access Issue (Because of my WiFi Connection).. and once I Disconnected/Disabled my WiFi and connected only via a Cable (secured and stable) connection.. the error went away..
Also I did the following, such as:
Restarted All SQL Server Services. Restarted My SQLServer Instance. Added these props to my DEF connection string..
Connection Lifetime=30; Max Pool Size=350;Connection Timeout=30;Connection Lifetime=0;ConnectRetryCount=3;ConnectRetryInterval=10;
This was a DNS error for me, diagnosed because using the server name in the connection string produced the error, but using the IP worked fine. Open cmd prompt, run a quick ipconfig /flushdns
to see if it helps.