如何从.NET Framework构建的项目中引用.NET Core构建的项目? [英] How to reference a project built in .NET Core from one built from .NET Framework?

查看:149
本文介绍了如何从.NET Framework构建的项目中引用.NET Core构建的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前遇到此错误:

项目[…]的命运为"netcoreapp2.1".不能使用".NETFramework,Version = v4.6.1"作为命运引用此项目.

The project […] has "netcoreapp2.1" as destiny. This Project cannot be referenced with ".NETFramework,Version=v4.6.1" as Destiny.

我得到了错误,我的项目在Net中..NET代码中的框架和库.好吧.

I get the error, my project is in Net. Framework and the library in .NET Code. Ok.

问题是项目只能同时在Net中.框架(它是Windows窗体)而不是其他任何窗体,而仅是.NET Core中的库,尝试在项目属性中进行更改是没有用的.

Problem is that project can apperently only be in Net. Framework (it's a Windows form) and not in any other one, and library only in .NET Core, attempting to change it in project properties is no use.

如何实现我所说的?

推荐答案

不幸的是,这无法实现.如果您有源代码,则可以将netcore项目中的目标更改为netstandard,netcore和.NET都可以引用该目标.

Unfortunately, this cannot be achieved. If you do have the source code, you can change the target in the netcore project to netstandard which can be referenced by both netcore and .NET.

这篇关于如何从.NET Framework构建的项目中引用.NET Core构建的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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