[英]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.