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 解析器 - 如何部署?


- 如何用自己压缩一个 IEnumerable 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01