本文介绍了dotnetcore和Framework 4.5之间的兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在向现有解决方案中添加一个新的dotnetcore(RC2)项目,其中包含一组dotnet framewotk 4.5项目.

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

当我尝试在全新的dotnetcore项目中添加引用时,我收到一条消息,告诉我无法从针对框架4.5的项目中进行引用.

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.

我关注了这个线程,但是我没有找到解决该问题的明确方法

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

在这种情况下推荐的方法是什么?

what's the recommended approach for this situation?

推荐答案

用新的 Class Library (Portable) 项目(PCL).到达那里后,您可以定位PCL配置文件或新的 Net Standard

您还可以有2个单独的项目文件,构建相同的源文件,但是每个文件都针对不同的框架/目标(一个用于PCL,一个用于.NET fw).

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

在这里您可以逐步进行操作: https://oren.codes/2016/06/23/portable-is-dead-long-live-netstandard/

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

这篇关于dotnetcore和Framework 4.5之间的兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 18:15