SSMS : How to fix SQL Server Management Studio not opening problem

microsoft sql server management studio not opening problem-thumb

Recently, I installed the SQL Server Management Studio 18 (SSMS) and after just one use, it didn't want to start anymore. The SQL Server Management Studio stopped loading after splash screen showing up for a brief moment and no messages appeared to show me what was wrong, except for Windows playing the default beep sound notifying me of a problem. In this article, I will show you how I solved this issue.

First, I assumed, the SSMS 18 didn't want to open due to another process running, but looking at the Task Manager, there was none. Next, I tried using repair option which is shown next.

Using Repair option

We can use the Repair option that is located in "Programs and Features", but the option is a bit hidden. The steps are as follows:

  • On Windows, run the "Programs and Features" utility.
  • From the list of installed applications, select "Microsoft SQL Server Management Studio" and click on the Uninstall button. This will cause the following window to open:
    microsoft sql server management studio 18 repair option
  • Click on Repair button, which will take a while to complete.
  • You will need to restart the computer.

Now if we are lucky, the problem would be solved by now, but in my case, there was no change. Next, I wanted to see if there is some sort of log file for the SQL Server Management Studio, so I could examine it and find out why the application doesn't want to open.

Using the SQL Server Management Studio log file

It turns out, there indeed is a logging feature available, but to use it, we need to run the executing file using a -log argument.

The steps are as follows:

  • Open Windows Explorer and go to the installed folder of the SQL Server Management Studio. In my case using Windows 10, this was at C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE
  • Once there, type cmd in the address bar and press enter:

    running cmd from file explorer address bar

  • The command prompt will open at that specific path. The executable file for the SQL Server Management Studio is ssms.exe and we need to run it with the logging enabled. We do this by using -log argument, followed by the location and the name of the log file. We need to specify the full path to the log file, something like this:
    ssms.exe -log d:\log.txt
    

    This will create a log file at d:\log.txt. Simply modify it to the path of your choice.

  • When the application fails to open again, find the log file and open it using a text editor, like notepad.

Examining the content of the SSMS log file

Looking at the generated ssms.exe log file, it consisted of multiple <entry> tags and some of them were Errors showing 80004005 - E_FAIL. All those errors in a log file happened when the two tasks below were attempted:

  • CreateInstance failed for package [Async Query Service Package]
  • CreateInstance failed for package [Task Scheduler Package]

In both cases, they had the same detailed description of the error:

Source: 'mscorlib' Description: Could not load file or assembly 'Microsoft.VisualStudio.Shell.Interop.8.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040) System.IO.FileLoadException: Could not load file or assembly 'Microsoft.VisualStudio.Shell.Interop.8.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
...

The issue with the Microsoft.VisualStudio.Shell.Interop.8.0 library

So it seemed, the issue had something to do with the Microsoft.VisualStudio.Shell.Interop.8.0.dll file. I searched for this .dll library inside the installed "Microsoft SQL Server Management Studio 18" folder and found two files located at the following path:

  • C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\PublicAssemblies
  • C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\PrivateAssemblies\Interop

Both files had the same size of 168KB and both showed the same 8.0.50727.938 version when checked the information under Properties:

Microsoft.VisualStudio.Shell.Interop.8.0 dll properties

But, even though, those two files looked identical, by examining the content of the files, it was obvious that they were not the same.

To try to figure out, what was going on, I ran the following command in PowerShell to check for the Assembly version of both library files.

[System.Reflection.Assembly]::LoadFrom("Full Path to Microsoft.VisualStudio.Shell.Interop.8.0.dll").GetName()

For a .dll file located in the PublicAssemblies folder, the result was:

Version Name
8.0.0.0 Microsoft.VisualStudio.Shell.Interop.8.0

And for a .dll file located in the PrivateAssemblies\Interop folder, the result was:

Version Name
15.0.0.0 Microsoft.VisualStudio.Shell.Interop.8.0

From this information, the error message of "The located assembly's manifest definition does not match the assembly reference" made more sense now.

Solution

In the end, the solution was to copy the PrivateAssemblies\Interop\Microsoft.VisualStudio.Shell.Interop.8.0.dll file (the one with assembly version 15.0.0.0) into the PublicAssemblies folder.

The steps I did were the following:

  • First, as a precaution, I renamed the existing PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.8.0.dll to something else, just in case I would need that file later.
  • Then I copied the Microsoft.VisualStudio.Shell.Interop.8.0.dll file from PrivateAssemblies\Interop into the PublicAssemblies folder.

After this change, the SSMS loaded without any issue.

Conclusion

If you run SQL Server Management Studio 18, but it doesn't open and doesn't give you any error message, it might look like a tough problem to solve. One option is to use Repair located in "Programs and Features", but if that doesn't work, we can also use the ssms.exe log option. In my case, the log file was showing an issue with the Microsoft.VisualStudio.Shell.Interop.8.0 library file. It turns out, the installed folder contains two such .dll files and solution was to copy the one at PrivateAssemblies folder into the PublicAssemblies folder.

Tags:

36 Comments

Click HERE to add your Comment
  1. Joost
    June 9, 2019
  2. MM
    June 11, 2019
  3. Steve
    June 11, 2019
  4. Phil
    June 12, 2019
  5. HemsbyHammer
    June 13, 2019
  6. Jabbo
    June 13, 2019
  7. Edgar
    June 13, 2019
  8. Nikki
    June 15, 2019
  9. Dudley T
    June 17, 2019
  10. Dave
    June 18, 2019
  11. Kaleb
    July 2, 2019
  12. Gilles
    July 4, 2019
  13. Zuhal
    July 7, 2019
  14. JayP
    July 8, 2019
  15. Andre
    July 9, 2019
  16. Reham Murrar
    July 12, 2019
  17. Umapda
    July 24, 2019
  18. Alv
    July 25, 2019
  19. Lukรกลก
    July 25, 2019
  20. VadP
    July 26, 2019
  21. David
    July 30, 2019
  22. bigDAN
    July 31, 2019
  23. Anns
    August 6, 2019
  24. olivier
    August 7, 2019
  25. salex
    August 9, 2019
  26. Chris
    August 12, 2019
  27. Nori
    August 15, 2019
  28. Carlos
    August 30, 2019
  29. Gurvinder
    September 4, 2019
  30. Aracelli Manrique
    September 10, 2019
  31. Kalpesh
    September 12, 2019
  32. santhosh
    September 21, 2019
  33. TomerZ
    September 24, 2019
  34. labichea
    September 24, 2019
  35. javier
    October 14, 2019
  36. Manikandan
    October 31, 2019

Write a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.