How to have two project in .net solution one targe

2019-08-14 18:27发布

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?

1条回答
再贱就再见
2楼-- · 2019-08-14 18:52

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...

查看更多
登录 后发表回答