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

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

问题描述

我正在使用 .net 开发 REST Web 服务器.我需要调用针对 .net 框架 v4.0 编译的第 3 方程序集.在 VS 2017 中,我为我的项目选择了ASP .NET Core Web 应用程序"(.NET Core 2.1)模板.我尝试使用 Project: Add->Reference... 添加第 3 方程序集但是,我在 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 core 可以调用 .net 4 程序集吗?如果是这样,我如何正确地将它们添加到项目中?

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 core 可以调用 .net 4 程序集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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