Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net Framework Nuget Package in .Net Core Project

Is it possible to use a nuget package written in the .net framework inside a .net core project?

As I've tried to use inject one of the classes from the .net framework project into the .net core project but it stops any requests getting through to the controller

like image 542
Ben Donnelly Avatar asked Mar 07 '23 22:03

Ben Donnelly


1 Answers

Well the answer is not so straight forward. I will try to explain here-

While sharing libraries between .net versions, keep it in mind that the .Net Standard is based on a subset of the overall APIs currently available in the .Net Framework. Many of the APIs that you may have grown accustomed to using in the .Net Framework will not be part of the .Net Standard, particularly once you get into those areas that have been most heavily refactored by .Net Core (e.g. ASP.Net).

You can use this extension for visual studio to check the compatibility. I have worked on projects where I have ported .NET web API applications into .NET-core web API applications. Some of the useful packages you'll find in nuget available for .NET core. But some you won't find. Also most of the packages by Microsoft are also re-written so, expect some change over the old syntax and member/method names. I suggest check-out the compatibility & dependencies of the packages you are downloading from nuget.

You can go through this article for more clear understanding.

like image 94
Sudip Avatar answered Mar 20 '23 11:03

Sudip