Error message when you execute a CLR routine or use an assembly in SQL Server 2005: “Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0×80131050)”
Symptoms
Consider the following scenarios.
Scenario 1You create a common language runtime (CLR) routine that references a Microsoft .NET Framework assembly. The .NET Framework assembly is not documented in Knowledge Base article 922672. Then, you install the .NET Framework 3.5 or a .NET Framework 2.0-based hotfix.
Scenario 2You create an assembly, and then you register the assembly in a Microsoft SQL Server 2005 database. Then, you install a different version of the assembly in the Global Assembly Cache (GAC).
When you execute the CLR routine or use the assembly from either of these scenarios in SQL Server 2005, you receive an error message that resembles the following:
Server: Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user defined routine or aggregate ‘getsid’:
System.IO.FileLoadException: Could not load file or assembly ‘System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0×80131050)
System.IO.FileLoadException:
Resolution
When the CLR loads an assembly, the CLR verifies that the same assembly is in the GAC. If the same assembly is in the GAC, the CLR verifies that the Module Version IDs (MVIDs) of these assemblies match. If the MVIDs of these assemblies do not match, you receive the error message that the “Symptoms” section mentions.
When an assembly is recompiled, the MVID of the assembly changes. Therefore, if you update the .NET Framework, the .NET Framework assemblies have different MVIDs because those assemblies are recompiled. Additionally, if you update your own assembly, the assembly is recompiled. Therefore, the assembly also has a different MVID.

Leave a Reply