.net核心可以调用.net 4程序集吗? [英] Can .net core call .net 4 assemblies?

查看:85
本文介绍了.net核心可以调用.net 4程序集吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.net开发REST Web服务器。我需要调用针对.net Framework v4.0编译的第三方程序集。
在VS 2017中,我为项目选择 ASP .NET Core Web应用程序(.NET Core 2.1)模板。
我尝试使用Project添加第3方程序集:Add-> Reference ...
但是,我在Project:Assemblies树形视图的程序集上看到黄色警告标志图标。这些属性页程序集全部为空。

I am developing a REST web server using .net. I need to call 3rd party assemblies that was compiled against .net framework v4.0. In VS 2017 I choose the "ASP .NET Core Web Application" (.NET Core 2.1) template for my project. I try to add the 3rd party assemblies by using Project: Add->Reference... However I get yellow warning sign icons on the assemblies in the Project:Assemblies tree view.The properties page for these assemblies are all blank.

.net核心可以调用.net 4程序集吗?如果这样,如何将它们正确添加到项目中? / p>

Can .net core call .net 4 assemblies? If so how do I add them to the project correctly?

推荐答案

否。 .NET核心项目无法引用旧版.NET 4.x程序集。因此,需要重建该库以支持.NETCore。

No. .NET core project cannot refer legacy .NET 4.x assemblies. So the library needs to be rebuilt to support .NETCore.

最近,Microsoft发布了.NET Standard来为两个平台构建库,但是程序集仍然不同。它只是被编译成不同的目标。

Recently Microsoft has released .NET Standard to build library for both platforms, however, the assemblies remain different. It's just compiled into different targets.

这篇关于.net核心可以调用.net 4程序集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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