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

查看:31
本文介绍了在完整框架 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 Full Framework 4.7 的 WPF 项目.我无法引用 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 项目的引用添加到 .NET Framework 项目.

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.

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

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