title: SQL Server connection timeout on VS2017
body: <p>I have a console application which is doing a standard:</p>
  
  <pre><code>new SqlConnection("&lt;connection string&gt;").Open()
  </code></pre>
  
  <p>but is timing out with the below exception (eventually):</p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException (0x80131904): A network-related or
    instance-specific error occurred while establishing a connection to
    SQL Server. The server was not found or was not accessible. Verify
    that the instance name is correct and that SQL Server is configured to
    allow remote connections. (provider: TCP Provider, error: 0 - The wait
    operation timed out.) ---> System.ComponentModel.Win32Exception
    (0x80004005): The wait operation timed out</p>
  </blockquote>
  
  <p>while attempting to open a connection to an (Azure hosted) SQL Server 12 instance. I'm having trouble pinpointing what's cause the problem, as:</p>
  
  <ol>
  <li>It only happens in VS2017. VS2015 runs the exact same code fine.</li>
  <li>I have no trouble connecting to the DB via SSMS, LINQPad and an ASP.NET project in the same solution (even when using 2017).</li>
  <li>The connection timeout is set to 30 seconds.</li>
  <li>It only happens when running in Debug mode.</li>
  <li>It also happens when connecting to local db.</li>
  </ol>
  
  <p>.NET 4.5.2, VS15.0.0, Win10</p>
  
  <p>Any ideas appreciated, I'm at a loss what could be causing this.</p>
  
  <p>Edit: Seems to have started working. I'm not exactly sure why, but possibly the upgrade to VS15.1 did the trick. Thanks all for suggestions.</p>