如何在 .NET 3.5 项目中引用 .NET 4.0 程序集 [英] How to reference .NET 4.0 assembly within .NET 3.5 projects
问题描述
我想使用 .NET 4.0 做一些 Office Interop 的事情,但使用 VS2008 和 .NET3.5 开发我项目的其余部分.
I would like to do some Office Interop stuff using .NET 4.0, but developing the rest of my project using VS2008 and .NET3.5.
我现在如何在其他解决方案中使用 .NET 4.0 程序集中的功能.无法将 CLR 4.0 程序集加载到 2.0 AppDomain 中,是吗?
How can I now use the functionality from the .NET 4.0 assembly within my other solution. Loading CLR 4.0 assemblies into a 2.0 AppDomain won't work, will it?
推荐答案
简而言之:你不能.
.NET 4.0 是一个全新的 CLR (4.0),据我所知,不能与 .NET 3.5 混合和/或在 VS 2008 中使用,抱歉.
.NET 4.0 is a totally new CLR (4.0) and as far as I know, cannot be intermixed with .NET 3.5 and/or used from VS 2008, sorry.
您可以使用 .NET 4.0 代码中的 .NET 2.0 程序集,前提是您还保证 .NET 2.0 框架与 .NET 4 同时(并排)在您的目标机器上.
You could use .NET 2.0 assemblies from your .NET 4.0 code, if you also have a guarantee that the .NET 2.0 framework is on your target machine at the same time (side-by-side) with .NET 4.
这篇关于如何在 .NET 3.5 项目中引用 .NET 4.0 程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!