在C#CLR的SQL Server 2008 R2 newtonsoft.json解析器 - 如何部署? [英] newtonsoft.json parser in a C# CLR for SQL Server 2008 R2 - How to deploy?

查看:1104
本文介绍了在C#CLR的SQL Server 2008 R2 newtonsoft.json解析器 - 如何部署?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 CLR ,它使用 newtonsoft JSON解析器。

I have created a CLR which uses the newtonsoft json parser.

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

I need to deploy the CLR. I have created an assembly for the parser dependency:

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

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

The above statement throws an error:

`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.



我使用的版本 7.xx 的在解析器
我瞄准 .NET 3.5

什么是部署<$ C $正确的步骤C> CLR 到 SQL Server 2008 R2的

推荐答案

对不起,我做了我的意见是不正确的假设。只有某些库在GAC 的支持在默认情况下SQL CLR。

Sorry, I had made an incorrect assumption in my comment. Only certain libraries in the GAC are supported for SQL CLR by default.

为了使用该库,你需要明确地添加它。

In order to use that library, you'll need to explicitly add it as well.

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,而不是框架。

If you are using 64-bit SQL Server, make sure you use Framework64 instead of Framework.

这篇关于在C#CLR的SQL Server 2008 R2 newtonsoft.json解析器 - 如何部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆