Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use .net core DLL in Framework 4.6 project

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.

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.

What's the standard way to integrate a .net core 2.0-DLL in a full-framework-project?

like image 476
user2033412 Avatar asked Sep 08 '17 05:09

user2033412


People also ask

Can I use NET Core library in NET Framework project?

once you add the requisite framework and build, you can reference the . NET CORE project from your . NET 4.6 application directly.

Can I use .NET Framework DLL in .NET 6?

Yes, you can load . NET Framework assemblies into . NET Core 5 and 6.

Can you mix .NET Framework and .NET Core?

NET Standard support - it can't, as it doesn't even support async/await . You need to upgrade to . NET 4.6.


1 Answers

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.

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

like image 127
Roman Doskoch Avatar answered Sep 21 '22 04:09

Roman Doskoch