Even the error message being very clear of what was going on, I wasn’t expecting this behavior since it is not usual to mess around with system DLLs registrations.
After a server migration some CLR routines stopped working on the new server showing the following error.
1 2 3 4 5 6
Msg 6522, Level 16, State 1, Line 1 A .NET Framework error occurred during execution of user-defined routine or aggregate "MyUserRoutine": System.IO.FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050) See Microsoft Knowledge Base article 949080 for more information. System.IO.FileLoadException: at MyNamespace.MyUserRoutine(String param0, String param1, String param2, String param3, String param4, String param5, String param6, String param7, String param8, String param9)
Checking DLL load
At first I was expecting this error had something to do with the user DLL, so I decided to get it loaded outside SQLCLR just to check if it was ok.