Saturday, June 02, 2012

Visual Studio 2012 Show Stopper Collections

Just installed the VS2012 RC a few days ago. I am tallying any show stoppers.

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=4.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: 0x80131050)

System.IO.FileLoadException:

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 
FROM
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Messaging.dll'
WITH PERMISSION_SET = UNSAFE 
GO

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



Post a Comment