SQL Server 2008 R2的C#CLR中的newtonsoft.json解析器 – 如何部署?

我创建了一个使用newtonsoft json parser.CLR newtonsoft json parser.

我需要部署CLR 。 我为解析器依赖创建了一个程序集:

 CREATE ASSEMBLY [Newtonsoft.Json] FROM 'C:\share\Release\Newtonsoft.Json.dll' WITH PERMISSION_SET = UNSAFE 

上面的语句抛出一个错误:

 `Assembly 'Newtonsoft.Json' references assembly 'system.runtime.serialization, version=3.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(failed to retrieve text for this error. Reason: 15105)).` Please load the referenced assembly into the current database and retry your request. 

我正在使用parser 7.xx版本。 我的目标是.NET 3.5

CLR部署到sql server 2008 r2的正确步骤是什么?

对不起,我在评论中做了一个不正确的假设。 默认情况下,SQL CLR仅支持GAC中的某些库 。

要使用该库,您还需要明确添加它。

 CREATE ASSEMBLY System_Runtime_Serialization FROM 'C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\System.Runtime.Serialization.dll' WITH PERMISSION_SET = UNSAFE GO 

如果您使用的是64位SQL Server,请确保使用Framework64而不是Framework。