在Framework 4.6项目中使用.net核心DLL [英] Use .net core DLL in Framework 4.6 project

查看:217
本文介绍了在Framework 4.6项目中使用.net核心DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在.net core 2.0中构建了一个DLL,现在我想在使用.net 4.6.1框架的WinForms项目中使用它。

I have built a DLL in .net core 2.0 and I now want to use it in a WinForms-project using the .net 4.6.1-framework.

我可以引用该dll,但会收到一个 System.IO.FileLoadException,提示找不到 System.Runtime,版本4.2.0.0。

I can reference the dll but I get a "System.IO.FileLoadException" which says that "System.Runtime, Version 4.2.0.0" could not be found.

什么

推荐答案

根据 MSDN ,您应该引用.Net Standard并引用.Net Standard 2.0库应该在.Net Framework 4.6.1或更高版本上有一个项目,并安装.Net Core 2.0 SDK。

According to MSDN you should reference .Net Standard and to reference .Net Standard 2.0 library you should have a project on .Net Framework 4.6.1 or higher and installed .Net Core 2.0 SDK.

您应该将目标框架更改为WinForms项目的4.6.1,然后安装.Net Core SDK。

You should change target framework to 4.6.1 of your WinForms project and install .Net Core SDK.

这篇关于在Framework 4.6项目中使用.net核心DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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