Mixing .NET 3.5 with 4/4.5 assemblies in the same solution/project

↘锁芯ラ 提交于 2020-01-04 12:42:10

问题


I have a solution that most projects are compiled in .net 4.5 (I use async and tasks).
There are couple of projects that need to be compiled in .net 3.5 since they use SDK that support only .net 3.5.
If my "Common" project is compiled in 4.5, and I have a project with target framework 3.5 that needs it, Is it possible to add reference to the Common ? (e.g my logger interface is at Common and i get it with DI).

Thanks.

Output:

could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v3.5".

回答1:


As the compiler tells you, it is not possible. You can try to split your "Common" library into two parts, one built for 4.5 and another for 3.5 framework.



来源:https://stackoverflow.com/questions/15463163/mixing-net-3-5-with-4-4-5-assemblies-in-the-same-solution-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!