Introduction
This article will brief the basic difference between .Net Core and .Net Framework.
There are many articles has been written on this topic, but I will start the description from basic differences which will include the features of both the frameworks to advanced level which will include the difference in the architecture of both the frameworks.
Features of .Net Core that distinguish it from .Net Framework
.Net core is cross platform, i.e. the application built in .net core environment can run on Windows, MacOs and Linux
There are many articles has been written on this topic, but I will start the description from basic differences which will include the features of both the frameworks to advanced level which will include the difference in the architecture of both the frameworks.
Features of .Net Core that distinguish it from .Net Framework
Cross Platform
.Net core is cross platform, i.e. the application built in .net core environment can run on Windows, MacOs and Linux Open Source
.Net Core is open source, i.e., .Net Core source code projects are available on GitHub. There are thousands of developers are involved in development of .Net Core and improving its features and fixing bugs.
Modern
.Net Core is modern, i.e. the application can be built using .Net Core to fulfill the needs of today’s world.
High Performance
.Net Core is very fast as compare to .Net Framework. Due to this feature .net core is able to deliver best result than any other framework.
Multiple IDE Support
.Net Core application can be developed using Visual Studio as well as Visual Studio Code. Developers can choose their favorite IDE/ Text Editor and start building application using .Net Core.
Differences on the basis of architecture From the above points, we understood the basic difference between .Net Core and .Net Framework, now we will understand the difference between the two on the basis of architecture.
To understand the differences easily, we will create MVC (Model View Controller) applications using .NET Core and .NET Framework
To understand the project architectures, first I will add new MVC project using .Net Core and then I will add another project of MVC using .NET Framework (Standard) in the same Solution. The solution will look like below:
In the above image, we can see that there are some differences in the folders of the two projects. We will understand it one by one.
In the .Net Application there is “References”. If we expand it, we will see that there are lot of references. We can also add reference as per our requirement.
In the .NET Core, there is no “References” but there is “Dependencies”, if we expand it we will see there are lot of dependencies in a categorized way.
In the .Net Application, the css, bootstrap, js files are placed in the “Content” folder and the favicon is placed in the main folder of the application.
In the .Net Core Application, css, bootstrap, js files including favicon are placed in the “wwwroot” folder.
In the .Net Application, Web.config is considered a most important file for the application. In this file we use to write connection string and many more which are helpful in running the application. The Type of this file is XML.
In the .Net Core application, appsettings.json plays the same role as Web.config in the .Net Application. The Type of this file is json.
In .Net Core, there are two new files, i.e. “Program.cs” and “Startup.cs” which were not available in .NET Framework (Standard). Let’s take a look inside the Program.cs file
In .Net Core, every (web) application is considered and run as a console application.
Whenever there is a requirement to inject the dependency, this is taken place in the “Startup.cs” file.
Differences on the basis of architecture From the above points, we understood the basic difference between .Net Core and .Net Framework, now we will understand the difference between the two on the basis of architecture.
To understand the differences easily, we will create MVC (Model View Controller) applications using .NET Core and .NET Framework
To understand the project architectures, first I will add new MVC project using .Net Core and then I will add another project of MVC using .NET Framework (Standard) in the same Solution. The solution will look like below:
In the above image, we can see that there are some differences in the folders of the two projects. We will understand it one by one.
In the .Net Application there is “References”. If we expand it, we will see that there are lot of references. We can also add reference as per our requirement.
In the .NET Core, there is no “References” but there is “Dependencies”, if we expand it we will see there are lot of dependencies in a categorized way.
Key Points
Here “Dependencies” has taken over the “References”.In the .Net Application, the css, bootstrap, js files are placed in the “Content” folder and the favicon is placed in the main folder of the application.
In the .Net Core Application, css, bootstrap, js files including favicon are placed in the “wwwroot” folder.
In the .Net Application, Web.config is considered a most important file for the application. In this file we use to write connection string and many more which are helpful in running the application. The Type of this file is XML.
In the .Net Core application, appsettings.json plays the same role as Web.config in the .Net Application. The Type of this file is json.
In .Net Core, there are two new files, i.e. “Program.cs” and “Startup.cs” which were not available in .NET Framework (Standard). Let’s take a look inside the Program.cs file
In .Net Core, every (web) application is considered and run as a console application.
Whenever there is a requirement to inject the dependency, this is taken place in the “Startup.cs” file.
Summary
- In this article, we learnt about basic difference between .NET Core and .NET Framework.
- We learnt about features of .NET Core.
- We learnt about differences of the two frameworks on the basis of architectures.
- Discussed in brief about "Program.cs" and "Startup.cs" "Program.cs" and "Startup.cs", are most important files in .NET Core, we will discuss about these files in a very great detail in the next article.
0 comments:
Post a Comment