简体   繁体   中英

How to have two project in .net solution one targeting 4.0 framework and other one 4.5 framework?

I have a module which is using .Net 4.5 features and our application works for XP users also. So I was thinking of moving this .net 4.5 dependent module to separate project. How can I have a solution which is having two projects targeting to different version?

Each project in a solution is targeting it's specific version of .NET, so there is nothing special to that, BUT you can NOT reference that project/module targeting .NET 4.5 from the .NET 4.0 project.

If you need to target .NET 4.5 for some module your main application must also target .NET 4.5, so if there is no way around that features you need to ditch XP support, which is IMO not a bad thing as XP is not a supported OS anymore.

IF that feature from .NET 4.5 is the async / await -feature you could use the Microsoft.Bcl.Async -package an keep targeting .NET 4.0...

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