4

I have a fresh installation of Windows 10, on which Microsoft Visual Studio 2015 was installed (therefore, a default database was installed too). I installed SQL Server Management Studio 2016 (v13.0.16106.4) but could not connect with the following error message:

Cannot connect to MYSERVER\SQLEXPRESS.

Method not found: 'Void Microsoft.SqlServer.Management.Common.SqlConnectionInfo.set_IsActiveDirectoryUniversalAuth(Boolean)'. (ConnectionDlg)

I've since tried to:

  • Install SQL Server 2016
  • Uninstall both SQL Server 2016 and the one coming with Visual Studio 2015 (following http://intellitect.com/sql-server-2008-install-nightmare/)
  • Once everything was cleaned and after a reboot, install SQL Server 2016 with default settings
  • Repair Microsoft SQL Server Management Studio

Note that regardless of what I try to connect to (including typing junk in the server text box), I have the same message, which leads me to believe that the error happens before SSMS actually tries to connect to the server.

I'm out of ideas; it seems like a DLL file may be missing, but which one and why, I cannot say.

The only "useful" reference I have found is this technet forum post which refers to a "patch", but I can't find where this "patch" could be found, if it exists.

  • can you connect with sqlcmd? Perhaps sqlcmd -S localhost\SQLEXPRESS? – Max Vernon Mar 28 '17 at 20:09
  • I can indeed connect with sqlcmd -S mymachine\SQLEXPRESS; I can also run queries like SELECT * from sys.databases successfully. – Christian Rondeau Mar 28 '17 at 20:11
2

Note that this answer will allow some operations, but you'll still have a broken environment.

IMPORTANT: This allows connecting to a database and running queries, but you'll still get errors inside SSMS!

I'm not saying it's pretty, but I can now use SQL Server Express 2016.

Copy the file Microsoft.SqlServer.ConnectionInfo.dll from the folder:

C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio

to this folder (I strongly suggest you backup the file first, then you can overwrite the file):

C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.ConnectionInfo\13.0.0.0__89845dcd8080cc91

Why does it work?

Note that a Microsoft engineer would better answer this question, but here's my theory: for some reason, a different release of the same version of the Microsoft.SqlServer.ConnectionInfo assembly has been released publicly (e.g. as part of Visual Studio and SQL Server Express release). The one in the GAC did not contain the SqlConnectionInfo.IsActiveDirectoryUniversalAuth property, but SQL Server Management Studio Express expects it.

What we are doing here is just replacing the version in the GAC with the version that ships with SSMS Express, so that it loads this one instead. This will affect everything that depends on that dll file, but hopefully there's no breaking changes in an assembly that has the same version number...

How did I find this?

I found which dll file the class was specified in by searching the intertubes. I then used sysinternal's procmon to look at which version of that dll was in fact loaded. I searched my computer for other potential versions of that file, and simply tried disabling versions until I had a different error. I then tried replacing it with other versions in the SSMS Express installation folder, and it worked. So here we are!

Update

It's not solving everything though... here's an error I have when right-clicking on a database and selecting property.

Cannot show requested dialog. (SqlMgmt)
Method not found: 'Microsoft.SqlServer.Management.Common.DatabaseEngineEdition Microsoft.SqlServer.Management.Smo.SqlSmoObject.get_DatabaseEngineEdition()'. (SqlManagerUI)`

I have tried installing everything in the GAC without success either: ls "C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\*.d ll" | % { &"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" /if $_.FullName }

  • 1
    Have you tried SSMS 17? It is a whole lot more reliable in general than its predecessors. – LowlyDBA Nov 6 '17 at 21:31
  • Thanks this worked. SSMS 17 and SSDT is so buggy... I think the new large install splash screen is to cover all the bugs and errors being displayed. – Sting Aug 21 '18 at 15:03
1

I had the same error as you, with SQLServer 2016 too.
Starting from SQL Server 2017, SMO is distributed as a Nuget Package.

Beginning with SQL Server 2017 SMO is distributed as the Microsoft.SqlServer.SqlManagementObjects NuGet package to allow users to develop applications with SMO.

See link on msdn page : Installing SMO

Even if I use SQL Server 2016, it seems I needed to install nuget package instead of referencing Dlls like I used to do.

  • 1
    Sadly I ended up changing computer in the meantime, so I cannot verify it works for me. If someone confirms I'll mark your answer as the right one :) – Christian Rondeau Feb 9 '18 at 17:05
0

This just occurred on a 2016 SQL install, running the latest install of the Microsoft Office Manager to access the database after the install.

A simple reboot of the server post install will help resolve the issue. (if you didn't do it when installing the SSMS package in the first place).

Once rebooted, all was fine.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.