我想部署一个CLR TVF(表值函数)。在代码中,我使用JavaScriptSerializer来解析一些JSON字符串,所以我引用了System.Web.Extensions dll,并且我的问题从那里开始。SQL Server CLR加载程序集失败
项目的基础很好,但是当我尝试注册我收到以下错误的dll:
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程序从:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.Extensions.dll
我可以设置副本加载以真实或手动方式复制程序集,但随后引用错误会变得更深 -
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.
E事情工作正常,直到我引用Web.Extensions.dll。目标框架是.NET 4.
任何想法/解决方案?
SQL Server计算机上是否安装了.NET 4 Framework? –
是的,正如我所说的,当System.Web.Extensions.dll没有被引用时,一切正常。 – Klark