Compatibility between dotnetcore and framework 4.5

早过忘川 提交于 2019-12-02 01:34:41

问题


I'm adding a new dotnetcore (RC2) project to my existing solution which contains a set of dotnet framewotk 4.5 projects.

When I try to add a reference in my brand new dotnetcore project I get a message telling me that I can't do a reference from a project that targets framework 4.5.

The following projects are not supported references: "project name" has target frameworks that are incompatible with targets in current project "project name"

I followed this thread but I didn't find any clear solution for the issue.

what's the recommended approach for this situation?


回答1:


Replace your library's project file with a new Class Library (Portable) project (PCL). Once there, you can target a PCL profile or the new Net Standard

You can also have 2 separated project files, building the same source files, but each one targeting a different frameworks/target (one for PCL, one for .NET fw).

Here you have a step-by-step: https://oren.codes/2016/06/23/portable-is-dead-long-live-netstandard/



来源:https://stackoverflow.com/questions/37842366/compatibility-between-dotnetcore-and-framework-4-5

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