newtonsoft.json parser in a C# CLR for SQL Server 2008 R2 - How to deploy?(SQL Server 2008 R2 的 C# CLR 中的 newtonsoft.json 解析器 - 如何部署?)
问题描述
我创建了一个使用 newtonsoft json 解析器的 CLR.
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:shareReleaseNewtonsoft.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
I am using version 7.xx of the parser.
I am targeting .NET 3.5
将CLR部署到sql server 2008 r2的正确步骤是什么?
What is the proper procedure for deploying the CLR to sql server 2008 r2?
推荐答案
对不起,我在评论中做出了错误的假设.SQL CLR 默认仅支持 GAC 中的某些库.
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:WindowsMicrosoft.NETFrameworkv3.0Windows Communication FoundationSystem.Runtime.Serialization.dll'
WITH PERMISSION_SET = UNSAFE
GO
如果您使用的是 64 位 SQL Server,请确保您使用的是 Framework64 而不是 Framework.
If you are using 64-bit SQL Server, make sure you use Framework64 instead of Framework.
这篇关于SQL Server 2008 R2 的 C# CLR 中的 newtonsoft.json 解析器 - 如何部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQL Server 2008 R2 的 C# CLR 中的 newtonsoft.json 解析器 - 如何部署?
基础教程推荐
- C# 从 List<List<int>> 中删除重 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- WPF 模态进度窗口 2022-01-01
