开发者

CLR stored procedure needs to call .Net Assembly

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

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

'开发者_StackOverflow ', 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?

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?


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.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜