我有一个 CLR 存储过程,它引用在 VS 2008 中创建的使用 Linq 的程序集。我们将此程序集称为“MyLib”。
我似乎无法将“MyLib”放入我的 SQL 2005 数据库中。我执行以下操作:
CREATE ASSEMBLY [MyLib]
FROM 'C:\MyLib\bin\Release\MyLib.dll'
WITH PERMISSION_SET = UNSAFE
GO
但我收到错误:
Assembly 'MyLib' references assembly 'system.core, version=3.5.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(error not found)). Please
load the referenced assembly into the current database and retry your request.
除了为每个程序集编写“CREATE ASSEMBLY”命令之外,是否有一种更简单的方法可以将所有 .Net 3.5 程序集放入 SQL 2005 CLR 中?是否有一些“最佳实践”方法可以做到这一点?
查看这个线程 http://social.msdn.microsoft.com/forums/en-US/sqlnetfx/thread/3dfee9d1-0cfd-48da-a90f-100a7d67ee1c/。基本上,您必须手动获取要加载的新程序集,而不是从全局程序集缓存自动加载它们。
(2.0和3.5版本的CLR是相同的)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)