使用.NET 3.5组件SQL 2005 CLR? [英] Using .Net 3.5 assemblies SQL 2005 CLR?

查看:120
本文介绍了使用.NET 3.5组件SQL 2005 CLR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CLR存储过程引用了使用LINQ在VS 2008中创建的组件。让我们把这个集'MyLib中。

I have a CLR stored procedure that references an assembly created in VS 2008 that uses Linq. Lets call this assembly 'MyLib'.

我似乎无法得到'MyLib中'到我的SQL 2005数据库。我做到以下几点:

I can't seem to get 'MyLib' into my SQL 2005 database. I do the following:

CREATE ASSEMBLY [MyLib]
    FROM 'C:\MyLib\bin\Release\MyLib.dll'
WITH PERMISSION_SET = UNSAFE
GO

但我得到的错误:

But I get the error:

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.

有没有更简单的方式来获得所有的.Net 3.5组件到SQL 2005 CLR,其他比我写了一个CREATE ASSEMBLY命令为每一个?是否有这样做的一些最佳实践的方式?

Is there an easier way to get all of the .Net 3.5 assemblies into the SQL 2005 CLR, other than me writing out a 'CREATE ASSEMBLY' command for each one? Is there some "best practice" way of doing this?

推荐答案

查看<一个href="http://social.msdn.microsoft.com/forums/en-US/sqlnetfx/thread/3dfee9d1-0cfd-48da-a90f-100a7d67ee1c/"相对=nofollow>这个线程。基本上,你必须手动得到新的组件来加载,而不是它们被自动从全局程序集缓存加载的。

Check out this thread. Basically you have to manually get the new assemblies to load, instead of them being loaded automatically from the global assembly cache.

(CLR的版本2.0和3.5是一样的)

(the CLR for version 2.0 and 3.5 is the same)

这篇关于使用.NET 3.5组件SQL 2005 CLR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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