CLR存储过程需要调用.NET程序集 [英] CLR stored procedure needs to call .Net Assembly

查看:193
本文介绍了CLR存储过程需要调用.NET程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有写的.Net 3.5,由于SQL Server 2008的

I have a CLR stored procedure which is written .Net 3.5 due to the limitations of SQL Server 2008

从这个存储过程中我需要调用一个函数,它是在.NET 4.0组件,但是当我添加一个引用到它,我得到的错误

From within this stored procedure I need to call a function which is in a .Net 4.0 assembly but when I add a reference to it I get the error

,或一个依赖需要.NET的更高版本   比项目指定的框架...

' ', or one of its dependencies requires a later version of the .Net Framework than the one specified in the project...

有没有解决这个办法吗?

Is there any way around this?

我打电话的组件是一个外部组件,所以我不能够做任何修改,但我确实需要从我的CLR打电话吗?任何想法?

The assembly I am calling is an external assembly so I am not able to make any changes to it, but I do need to call it from my CLR? Any ideas?

推荐答案

根据这个<一个href="http://social.msdn.microsoft.com/Forums/en-US/netfxgeneral$p$prelease/thread/bef443cc-5413-4322-8d9a-117abd2386d3"相对=nofollow> MSDN论坛帖子 CLR的不是前锋compatable。这是在谈论 2.0至4.0的通信,但仍然适用于3.5至4.0还

According to this MSDN Forum Post the CLR's are not forward compatable. It is talking about 2.0 to 4.0 communication, it is still appropriate for 3.5 to 4.0 also.

还没有被CLR提供任何直接的CLR到CLR通信。 COM的使用可能是最好的主意。   还要注意的是2.0组件可以与4.0组件通信,但是它们必须在相同的CLR运行时(4.0在这种情况下)中运行。大会本身没有限制为2.0组件可在4.0 CLR运行时上运行。 CLR的运行时版本是重要的组成部分,而不是该组件是建立对CLR。

There is also not any direct CLR-to-CLR communication provided by CLR. Usage of COM is probably the best idea. Also note that 2.0 assembly can communicate with 4.0 assembly, but they have to run in the same CLR runtime (4.0 in this case). Assemblies by themselves are not restricted as 2.0 assembly can run in 4.0 CLR runtime. The CLR runtime version is the important part, not the CLR which the assembly was build against.

这篇关于CLR存储过程需要调用.NET程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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