简体   繁体   中英

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. Is there any workaround so that I can reference a .NET 4.5 dll from that .NET 4.0 project?

I realize that we could branch the project, one for each .NET version, but that introduces a lot of maintenance overhead....

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.

The issue is that we can't migrate the project to 4.5 because we have some products that must work on Windows XP.

If these products use the "core project", you'll need to leave it targeting .NET 4.0 or earlier. There is no way to use a .NET 4.5 assembly from any project on Windows XP.

If you need .NET 4.5 features, you'll need to either upgrade those projects, or maintain two versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM