SQL CLR "Corruption"
Symptom:I had an MSMQ triggering CLR in SQL Server 2012 Express. It seems that after installation of VS2012 the assembly stopped working.
When the assembly was called from a stored procedure, I got a message somewhat like this:
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.Messaging, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050)
Fix:You can correct this condition by ALTER ASSEMBLY. For example, if the Messaging DLL is corrupted in the above manner, I would do;
ALTER ASSEMBLY Messaging
WITH PERMISSION_SET = UNSAFE
Note, be sure to exit Visual Studio 2012 when you do this. You may get yet another issue which results in "Out of Resource" error.
Other Possible Issues:
- Exception has been thrown by the target of an invocation when dragging in the LinqDataSource control. -> See This Article