This blog post details the error you may get when using Visual Studio 2017 and you get errors that you cannot connect to SQL Server 2017 using Test Explorer or SQL Server Object Explorer.
TL;DR – upgrade Visual Studio from base version…..
I had built a new DEMO machine for showcasing Visual Studio, namely SQL Server Data Tools as well as vendor tools that help people “do DevOps” stuff with databases.
I cloned my repository in my Azure Repo (read up on them here https://azure.microsoft.com/en-us/services/devops/repos/ ) and kicked off a BUILD in Azure DevOps (read more here https://azure.microsoft.com/en-us/services/devops/ ) (formerly known as Visual Studio Team Services (VSTS)) and everything was going great.
I then wrote some unit tests for some stored procedures and went to build my solution in Visual Studio – which worked, then publish it to my local SQL Server 2017 instance – which failed.
The error was “Ensure you have the same name in master or <database>” which is a weird error.
Thing was – I had used Test Connection – which worked!!.
But the actual publish failed – couldn’t connect…. (what???)
So I went to use SQL Server Object Explorer in Visual Studio to try and connect and got the following error:
I upgraded my SQL Server 2017 instance to CU11 – mainly as my version was base version:
But of course in reflection (reflected whilst I waited for CU11 to upgrade my instance) – I could connect to SQL Server 2016 instances. But couldn’t connect to my Azure SQL instances…
…..what the???
Which then made me check the version of Visual Studio 2017.
It was version 15.0 – and lo and behold there was an update waiting in notifications area telling me that an upgrade to 15.8.7 was ready to be installed.
<Groan>
So I upgraded……
…….and things now work:
….and I can now (after a 2 hour hiatus of upgrades) go back to writing unit tests and running them against instances
Yip.