I wanted to understand the dot net core support a bit more. My basic understanding was that if I wanted to run a .net app on Linux then it needs to be built .net core and targeted netcoreapp1.0 framework to guarantee this. 1) I assume the above assumption is correct?
2) When I was reading various articles online, such as this one about referencing exiting .net framework project within a .net core application (https://www.hanselman.com/blog/HowToReferenceAnExistingNETFrameworkProjectInAnASPNETCore10WebApp.aspx) If I did this, presumably the app would only run on Windows and not Linux?
3) In the following article:
https://blogs.msdn.microsoft.com/cesardelatorre/2016/06/28/running-net-core-apps-on-multiple-frameworks-and-what-the-target-framework-monikers-tfms-are-about/
In context to running with .net run 4.5.2 option (
dotnet run -f NET452
), it's mentioned:
If this app were running on the .NET Core Platform, let’s say on a Linux box or a Mac, this code won’t be executed, but the app would still be running on Linux or MacOS.
What's the distinction between running and not executing? If my initial understanding was correct, then by running with .net 4.5.2 option on Linux I wouldn't expect the app not to run at all.
Appreciate a few questions there but really wanted to understand .net core a bit more.
There is a difference between .NET Core
and ASP.NET Core
and the articles you mentioned are about running ASP.NET Core
"apps" on .NET Framework
. Let my try to clarify this using a few declarative statements:
.NET Core
is the cross-platform runtime.ASP.NET Core
is a set of libraries that until version 1.1.* can run
on both .NET Framework
and .NET Core
. .NET Framework
application (=> e.g.
net452
) and use ASP.NET Core
in this application.netcoreapp*
and
net*
- but net*
currently only works on windows.This means that for netcoreapp1.*
, you cannot reference arbitrary libraries that have been built for .NET Framework. If you change the target framework to say net452
, you are no longer building a .net core application, but a .net framework application.
For ASP.NET Core 2.0
this is going to change. Again a few statements:
ASP.NET Core 2.0
is still a set of libraries but they can only be used on .NET Core 2.0
and not on .NET Framework
.NET Core 2.0
is able to freely reference libraries that have been built for .NET Framework
up to version 4.6.1
.NET Core
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With