Friday, July 20, 2018

What is the difference between a C# Console application that uses .NET core and the other using .NET Framework?

Both of them create programs that can be run from command line.

While you can create both types using templates available in Visual Studio Community 2017 shown, there are many differences.


ConsoleCore-Frame_0

One major difference is that .NET Core application can be used for creating cross-platform (Windows, Linux and macOS) applications while .NET Framework is for those dependent on .NET Framework libraries, or those that do not have similar functionality in .NET Core.

Also there may be platforms that do not support .NET Core in which case you have to use .NET Framework.

Here is the template for a console application that uses .NET Core (both program folder and code)



ConsoleCore-Frame_1

The Microsoft.NETCore.App is a huge library

Here is the code for the console application that uses .NET Framework.

ConsoleCore-Frame_2

No comments: