SQL Server CLR加载程序集失败

编程入门 行业动态 更新时间:2024-10-28 07:20:58
本文介绍了SQL Server CLR加载程序集失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试部署CLR TVF(表值函数).在代码中,我使用JavaScriptSerializer解析一些JSON字符串,因此我引用了System.Web.Extensions dll,而我的问题从此处开始.

I am trying to deploy an CLR TVF (table value function). In the code I am using JavaScriptSerializer to parse some JSON string, so I reference the System.Web.Extensions dll and my problems start there.

项目构建良好,但是当我尝试注册dll时,出现以下错误:

Project builds fine, but when I try to register the dll I receive the following error:

程序集"my_assembly_name"参考 程序集'system.web.extensions, 版本= 4.0.0.0,文化=中性, publickeytoken = 31bf3856ad364e35.", 当前不存在 数据库. SQL Server尝试执行 找到并自动加载 来自同一参考程序集 推荐集会来到的位置 来自,但操作失败 (原因:2(系统找不到 指定的文件.)).请加载 引用到当前的程序集 数据库,然后重试您的请求.

Assembly 'my_assembly_name' references assembly 'system.web.extensions, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35.', 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(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

我从以下位置引用了system.web.extensions:

I referenced system.web.extensions from:

C:\ Program Files(x86)\ Reference 程序集\ Microsoft \ Framework.NETFramework \ v4.0 \ System.Web.Extensions.dll

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.Extensions.dll

我可以将复制负载设置为true或手动复制程序集,但是引用错误会更深-

I can set copy load to true or manually copy the assembly but then referencing errors go deeper -

程序集"my_assembly_name"参考 部件 'system.servicemodel.activation, 版本= 4.0.0.0,文化=中性, publickeytoken = 31bf3856ad364e35.", 当前不存在 数据库. SQL Server尝试执行 找到并自动加载 来自同一参考程序集 推荐集会来到的位置 来自,但操作失败 (原因:2(系统找不到 指定的文件.)).请加载 引用到当前的程序集 数据库,然后重试您的请求.

Assembly 'my_assembly_name' references assembly 'system.servicemodel.activation, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35.', 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(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

一切正常,直到我引用了Web.Extensions.dll.目标框架是.NET 4.

Everything works fine until I reference the Web.Extensions.dll. Target Framework is .NET 4.

有什么想法/解决方案吗?

Any ideas/solutions?

推荐答案

.NET Framework CLR与SQL Server 2005/2008的不幸集成只是该框架的一个有限子集,而System.Web.Extensions似乎没有成为受支持的程序集/名称空间.

Sadly integration of the .NET Framework CLR with SQL Server 2005 / 2008 is only a limited subset of the framework and the System.Web.Extensions doesn't seem to be a supported assembly / namespace.

有关受支持程序集的完整列表,请查看MSDN: msdn .microsoft/en-us/library/ms403279.aspx

For a full list of supported assemblies check out MSDN: msdn.microsoft/en-us/library/ms403279.aspx

更多推荐

SQL Server CLR加载程序集失败

本文发布于:2023-11-13 09:38:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584025.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   程序   SQL   Server   CLR

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!