SQL Server CLR加载程序集失败 [英] Sql Server CLR load assembly failed

查看:292
本文介绍了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: http://msdn .microsoft.com/en-us/library/ms403279.aspx

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

这篇关于SQL Server CLR加载程序集失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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