【发布时间】:2016-02-21 01:29:28
【问题描述】:
我创建了一个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机器上安装了.net 3.5吗? System.Runtime.Serialization 应该在 GAC 中
-
我怎么知道?根据:msdn.microsoft.com/en-CA/library/hh925568(v=vs.110).aspx,如果我检查 NDP 子项,我有所有 .Net 版本(2、3、3.5、4、4.5(完整))的条目。在添加和删除程序中,存在 .net 4.5.2。据我了解,SQL Server 2008 R2 使用 .Net 3.5。它是否正确?注意:如果我尝试在我的 CLR 构建中以 .NET 4.0 为目标,部署会失败并说明错误的 .NET 版本。
标签: c# .net json sql-server-2008-r2 sqlclr