Recently, one of my clients reported a weird issue to me. They explained that when they right click on the database, and try to read its properties they were getting the following error message. Let us learn about error related to could not load file or assembly.
Here is the text of the message:
Could not load file or assembly ‘SqlManagerUi, Version=18.104.22.168, Culture=neutral, PublicKeyToken=89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified. (mscorlib)
I asked to check if they can open ANY properties window of ANY object in SSMS? They tested and found that none of the additional windows, like creating database, properties were opening. When I searched, I found that last part of the error is the real issue. In our case we are seeing “The system cannot find the file specified”.
We partially know the file name as it should be having SqlManagerUi in the name. Whenever there is a file missing issue, I always use Process Monitor
In process monitor, I filtered for SSMS.exe and found that SSMS was looking for SQLManagerUI.dll under C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio and it was missing from there. Note that the client’s SSMS version was SQL 2016. If you are using an older version, you might see path like C:\Program Files\Microsoft SQL Server\110\Tools\Binn\VSShell\Common7\IDE
When we compared this with a working machine, we also found that a huge number of files were missing from that folder. The common causes could be a (a) Viruses or other malware, (b) File system corruption and (c) Failing hard drive.
Finally, we had to repair the shared features, after that the issues were resolved. Here are the steps to repair the instance https://docs.microsoft.com/en-us/sql/database-engine/install-windows/repair-a-failed-sql-server-installation
Reference: Pinal Dave (https://blog.sqlauthority.com)