简体   繁体   English

我可以从.NET 4.0项目引用.NET 4.5项目吗?

[英]Can I reference a .NET 4.5 project from a .NET 4.0 project?

For complicated reasons involving historical projects, we have a core project that is shared across many products. 由于涉及历史项目的复杂原因,我们有一个在许多产品中共享的核心项目。 The issue is that we can't migrate the project to 4.5 because we have some products that must work on Windows XP. 问题是我们无法将项目迁移到4.5,因为我们有一些必须在Windows XP上运行的产品。 Is there any workaround so that I can reference a .NET 4.5 dll from that .NET 4.0 project? 是否有任何解决方法,以便我可以从该.NET 4.0项目引用.NET 4.5 dll?

I realize that we could branch the project, one for each .NET version, but that introduces a lot of maintenance overhead.... 我意识到我们可以分支项目,每个.NET版本一个,但这会带来很多维护开销....

Any help would be great! 任何帮助都会很棒!

EDIT - To be clear, we would like it to reference a .NET 4.5 dll, but any of our products that run on Windows XP wouldn't execute anything from it, only our newer products would utilize its features. 编辑 - 很明显,我们希望它引用.NET 4.5 dll,但我们在Windows XP上运行的任何产品都不会执行任何操作,只有我们的新产品才会使用它的功能。

The issue is that we can't migrate the project to 4.5 because we have some products that must work on Windows XP. 问题是我们无法将项目迁移到4.5,因为我们有一些必须在Windows XP上运行的产品。

If these products use the "core project", you'll need to leave it targeting .NET 4.0 or earlier. 如果这些产品使用“核心项目”,则需要将其保留为.NET 4.0或更早版本。 There is no way to use a .NET 4.5 assembly from any project on Windows XP. 无法在Windows XP上的任何项目中使用.NET 4.5程序集。

If you need .NET 4.5 features, you'll need to either upgrade those projects, or maintain two versions. 如果您需要.NET 4.5功能,则需要升级这些项目,或者维护两个版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在面向 4.0 的项目中引用面向 .net 4.5 的程序集? - Is it possible to reference an assembly that targets .net 4.5 in a project that targets 4.0? 将VC ++项目从.NET 4.0迁移到4.5? - Moving VC++ Project from .NET 4.0 to 4.5? 将.NET项目从4.5转换为4.0的最简单方法? - easiest way to convert .NET project from 4.5 to 4.0? 我可以在.net 4.5项目上安装分析仪吗? - Can I have an analyzer on a .net 4.5 project? 可以成功安装.NET 4.5的构建服务器将面向4.0的项目部署到仅安装了.NET 4.0的服务器吗? - Can a build server with .NET 4.5 installed successfully deploy a project targeting 4.0 to a server with only .NET 4.0 installed? 当我构建.NET 4.0项目时自动构建.NET 4.5项目吗? 不需要引用 - Autobuild a .NET 4.5 project when I build a .NET 4.0 project? It does NOT need to be referenced 从.NET 4.0项目(VSTO)引用在.NET 4.5.1中内置的库 - Reference a library built in .NET 4.5.1 from a .NET 4.0 project (VSTO) 我可以从 .NET 5 项目中添加对 .NET Framework DLL 的引用吗? - Can I add a reference to a .NET Framework DLL from a .NET 5 project? .NET 4.5程序集可以引用.NET 4.0程序集吗? - Can .NET 4.5 assemblies reference .NET 4.0 assemblies? 如果引荐来源引用.Net 4.5,为什么不能从另一个项目访问一个.Net Core项目? - Why can I not access one .Net Core project from another if the referrer references .Net 4.5?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM