Sunday, March 30, 2008

CLR Approved Assemblies

A little known fact about using CLR integration in SQL Server is that not all of the .NET Assemblies are available for use.

Supported .NET Framework Libraries

This means that in order to use components of the .NET Framework that are not supported, you have to first create them as a, generally UNSAFE, Assembly in the database. This however can lead to support issues with Microsoft Support, according to their KB Article

Bob Beauchemin covered this in a recent blog after upgrading .NET on a SQL 2005 Server. If you choose to reference an unsupported Assembly in your CLR code, your Assembly will cease to function and execution will result in an exception with Message 622 and an error ending with:

Assembly in host store has a different signature than assembly in GAC.

To correct, you must drop your assembly as well as the unsupported assemblies, and add them back so the GAC is refreshed with the newer version.

No comments:

Post a Comment