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.

I can connect with sqlcmd -S mymachine\SQLEXPRESS; I can also run queries like SELECT * from sys.databases successfully.

Hannah Vernon
71.1k22 gold badges178 silver badges323 bronze badges
asked Mar 28, 2017 at 20:02
0

3 Answers 3

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 Server130円\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.ConnectionInfo13円.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 Server130円\Tools\Binn\ManagementStudio\*.d ll" | % { &"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" /if $_.FullName }

answered Mar 29, 2017 at 20:14
0
2

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.

answered Feb 9, 2018 at 16:26
0
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

answered Apr 25, 2019 at 16:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.