This week we will discuss how to troubleshoot different assembly errors that we get while troubleshooting installs for SQL Server. I’ll focus this article more on SQL Server and Windows systems. Before I start, I’ll explain what is an assembly on Windows. Wikipedia describes an assembly in the CLI, as a compiled code library used for deployment, versioning, and security. CLI assemblies can have version information, allowing them to eliminate most conflicts between applications caused by shared assemblies.
Assembly Errors while installing SQL on Windows OS
So let get into the troubleshooting portion of the article.
Most of the time, assembly errors occur due to the leftovers of a failed installed i.e. the install went halfway through and did a roll-back. In such cases, we have to manually clean up the entries. It’s a little lengthy and seemingly complicated process, but I’ll try to make it as simple as I can. Before we start the process create a system restore point & create a backup of the registry. Please follow these articles to do that.
First of all, we have to remove any after over entries. If there isn’t any SQL installed on this machine, then just remove all the SQL entries from Programs & Features. If not, just remove SQL Server 2008 R2 and select the instance you are trying to install (Don’t remove anything else). If it’s not there, then leave it and let’s go to the next step.
The next step is going through the registry to make sure all the entries are removed. To be honest, it’s practically impossible to search and delete all the SQL entries, but we can delete only the important ones that we think will cause problems.
-
- Start –> Run –> Regedit
- Go to
32-bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
64-bit:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server
Delete the entries for the SQL instance you are trying to install. In case if you don’t have any other SQL then just delete the Microsoft SQL Server root folder itself
Now go to the following and delete entries for the SQL instance you are trying to install:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application
Then go to this one and delete entries for the SQL instance you are trying to install:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\
You will find multiple control sets like this one and so on. Repeat the same process:
ControlSet001, ControlSet002, ControlSet003, ControlSet004
Now go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
and delete entries for the SQL instance you are trying to install
Next go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
and delete entries for the SQL instance you are trying to install.
Now the next step is to remove the assembly entries for SQL. To do that
- Start –> Run –> assembly
- Look for assemblies started with Microsoft.SqlServer, once you find it right click and click on Uninstall
Now just to be sure you got all the entries there is a trick where can we switch the assembly view to folder view.
- In the command prompt, type cd /d %windows%\assembly
- Type: attrib -r -h -s desktop.ini
- Type ren desktop.ini desktop.bak
Or
- Go to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
- Add new binary value name “DisableCacheViewer”
- Right-click on “DisableCacheViewer” and click on Modify
- Enter 1
- Close the registry and try again
Now if you go back to assembly you should be folder views rather than assembly view. Now search for any Microsoft.SqlServer and remove it. Once you complete the process just clear the TEMP and reboot the system and try to install it again.
Now in some cases, you might still get assembly error, in most cases, it’s due to Microsoft .NET 4.0. I would recommend reinstalling the .NET Frameworks 4.0 and try to install it again. Also, Microsoft Visual C++ might also cause such errors. Reinstalling them would be a good idea.
There is another scenario where the error is caused by Microsoft SQL Server RsFx Driver MSI. In such cases, we can try two things. One is to create a missing entry in the registry or to remove the driver from the Installer folder.
Method 1:
- Start –> Run –> Regedit
- Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RsFx0150
- Right-click on the RsFX0150 and click on New key and type in InstancesShares
- Now close the registry and try to install it again.
Method 2:
- Start –> Run –> Installer
- Once the folder opens you’ll send a lot of columns, Right-click on any of the column names and select More
- From the list select Comments and click OK.
- Now look for Microsoft SQL Server RsFx Driver MSI in comments (Because the actual file name will be gibberish)
- Right-click on the MSI file and click on Uninstall
How do I fix SQL Server installation error?
Although there is no one-click solution to fix any SQL server installation error, you can follow the aforementioned guide to get some help. Depending upon the error, you might need to change a few things on your computer in order to troubleshoot the issue. This guide explains some of the common issues so that you can get your server running quickly.
Why SQL Server is not installing?
There could be several reasons why the SQL server is not installed. From an internal issue to rogue client, anything could be responsible for this error. However, it is recommended to use the Microsoft Installation Cleanup Utility to get your problem fixed.
Well using this method you should be able to resolve most of the assembly-related errors when installing Microsoft SQL Server.