The .NET Core project adds a reference to the .NET Framework project. Why is this possible?

I have the following projects:

.NET Core 2.0 Web Application

.NET Standard 2.0 library and

Class Framework .NET Framework 4.5.

I am adding a link to the .net framework class library to the asp.net core web api project. and it seems to work very well.

I am wondering why you can add a link to the .NET Framework class library project on the ASP.NET Core Web API or MVC?

Are you planning to add only standard or core libraries of links to major projects? Is this base web project with .NET Framework class library libraries still crossing the platform?

UPDATE:

According to Phiter comment:

β€œIf you import the framework.net library into your project, it will no longer be a cross-platform, but you can do it freely if you want. They allow it because you can use the .net core and still be on windows. "

So, if this is the reason, if I want to bind my project to the .NET Framework and stay on Windows, why am I using the Core Web Project from the first place?

I thought we were using major projects for cross-platform capability, and if not, is the .Net infrastructure not the best option?

UPDATE

mason comment:

β€œNothing funny: an ASP.NET Core project should not run on .NET Core. It can also be run on the .NET Framework.

Just because it's called Core does not mean that they are connected. They could call it ASP.NET FancyPants and run it on the .NET Core and .NET Framework, and you wouldn't be as embarrassed as well. Microsoft just sucks to call things. "

+5
source share
2 answers

This was just added as part of the .NET Standard / Core 2.0 . While the DLL.NET Framework only refers to things in the .NET standard, it will use type redirection to implement .NET Core.

+4
source

I do not know what made Microsoft allow the link to the .net framework class library to the .net kernel project, but as a programmer, I am pleased with this tutorial.

You see that the .net resolving core for referencing the .net framework libraries is useful if you want to start with Windows and plan to switch to the cross platform in the future.

We are at a stage where many useful open source libraries do not fully support the .net core before the date of this post, masstransit is an example, so when I develop new software, I will use the main .net project, which depends on such libraries, and I will update them later, when they will support the .net kernel.

+2
source

Source: https://habr.com/ru/post/1274166/


All Articles