Posted By: PerfectPhase | Jul 24th, 2008 @ 9:28 AM
page 1 of 1
Comments: 4 | Views: 1142
PerfectPhase
PerfectPhase
"This is not war, this is pest control!" - Dalek to Cyberman

I'm having a bit of a problem with a SQLCLR assembly in SQL Server.  I'm trying to use System.Messaging, which isn't on the list of natively supported assemblies in 2005, so I've loaded it with 


CREATE ASSEMBLY [System.Messaging]
AUTHORIZATION dbo
FROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Messaging.dll'
WITH PERMISSION_SET = UNSAFE

So I now have a copy of the assembly in the GAC/On Disk and I have the copy loaded in SQL server.  At this point everything works fine.

Now I come along and install service pack 2 for .Net V2 and I start getting the following errors from my SQLCLR assembly

System.IO.FileLoadException: Could not load file or assembly 'System.Messaging, 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: 0x80131050)

Having a look around it seems to be a known issue http://support.microsoft.com/Default.aspx?kbid=949080 with no sign of a solution, so I was just wondering if anyone else had to deal with this, and what your solution, if any, was.  For the moment I am having to take the brute force approach and drop re-create the assembly when the problem arises.

Cheers,

Stephen.

figuerres
figuerres
???
have you tried removing it from SQL and then re-adding it??

Opps, while posting I saw the last comment... I think you will have to as I think when you add to SQL it copies the code into sql server.
I've the same problem with System.Runtime.Serialization assembly. over a x64 windows

The solution was, find the System.Runtime.Serialization in c:\windows\assembly directory, copy it to other directory and run the CREATE ASSEMBLY sql command.

Best,

Excellent, that did the trick for me Marcos!

in my case, it was this folder:

C:\WINDOWS\assembly\GAC_MSIL\System.DirectoryServices\2.0.0.0__b03f5f7f11d50a3a\

page 1 of 1
Comments: 4 | Views: 1142
Microsoft Communities