在Full Framework 4.7项目上添加对.NET Core 2.0 DLL的引用 [英] Add reference to a .NET Core 2.0 DLL on a Full Framework 4.7 project

查看:373
本文介绍了在Full Framework 4.7项目上添加对.NET Core 2.0 DLL的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里寻找了这个问题,但没有找到答案。

I looked for this question in here but I didn't find the answer.

我有一个针对.NET Core 2.0的类库项目和一个针对.NET Core 2.0的WPF项目。 .NET完整框架4.7。我无法在WPF项目中引用类库。我收到以下错误消息:

I have a Class Library project targeting .NET Core 2.0 and a WPF project targeting .NET Full Framework 4.7. I can't reference the class library on the WPF project. I get the following error:


项目 xxxxxxxx目标为 .NETCoreApp,Version = v2.0。面向'.NETFramework,Version = v4.7'的项目不能引用

Project 'xxxxxxxx' targets '.NETCoreApp,Version=v2.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.7'.

有没有完整框架中引用.NET Core项目的一种方法?

Is there any way to reference a .NET Core project in a Full Framework one?

推荐答案

您不能添加对.NET Core项目的引用

You cannot add a reference to a .NET Core project to a .NET Framework project.

要在.NET Core和.NET Framework应用程序/库之间共享代码,共享项目必须以.NET Standard为目标。如果创建.NET Standard 2.0项目,则可以在.NET Framework 4.6.1+项目和.NET Core 2.0+项目中使用。

To share code between .NET Core and .NET Framework apps / libraries, the shared project must target .NET Standard. If you create a .NET Standard 2.0 project, it can be used in .NET Framework 4.6.1+ projects and .NET Core 2.0+ projects.

这篇关于在Full Framework 4.7项目上添加对.NET Core 2.0 DLL的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆