.Net Core vs .Net Framework differences

by | Sep 6, 2023 | .Net Core, Learn | 0 comments

CLR vs Core CLR

What is CoreCLR

The CoreCLR provides many similar functionalities as the CLR, but it is specifically designed for the cross-platform nature of .NET Core.

General CLR feature

includes features like Just-In-Time (JIT) compilation, garbage collection, exception handling, and security, which are essential for executing .NET Core applications.

Smaller FootPrint

CoreCLR has a smaller footprint compared to the full CLR in the .NET Framework, as .NET Core is optimized for lightweight and high-performance scenarios

AOD (Ahead Of Time Compilation support)

CoreCLR supports ahead-of-time (AOT) compilation, which allows the Intermediate Language (IL) code to be precompiled into machine code, reducing startup times and enabling deployment scenarios without the need for a JIT compiler.

BCL/FCL vs CoreFX

BCL/FCL- Used in .Net Framework

CoreFX- Used in .Net Core

  • CoreFx – Its like BCL, used for new .Net Core.
  • CoreFX is the foundational library used by .NET Core. It provides a set of core functionalities and types that are used to build applications on the .NET Core platform.
  • CoreFX includes various components like collections, file I/O, networking, cryptography, and more. These components are designed to be cross-platform and optimized for performance.
  • With CoreFX, developers can build applications that are independent of the underlying operating system and can run on multiple platforms without requiring modification.
  • CoreFX provides a similar set of core functionalities
  • designed specifically for the cross-platform and modular nature of .NET Core.
  • designed specifically for the cross-platform and modular nature of .NET Core.
  • Some types and functionalities in the .NET Framework may have been redesigned or optimized in CoreFX to better align with the goals of .NET Core.

Roslyn Compiler (.net core) vs Traditional .Net Compiler

  • A New .Net Core compiler more efficiently works with .Net Core.
  • Roslyn is an open-source .NET Compiler Platform. It provides a set of compilers and APIs for building applications that work with source code. Roslyn includes both a C# compiler and a VB .NET compiler.
  • Source Code Analysis: Roslyn allows deep analysis and understanding of source code, going beyond simple compilation.
  • Rich API: Roslyn exposes a rich set of APIs that enable developers to programmatically analyze, manipulate, and generate code.
  • Code Refactoring: It supports advanced code refactoring, allowing automated code modifications while maintaining correctness.
  • IDE Integration: Roslyn is deeply integrated with development environments like Visual Studio, providing features like code completion, real-time error checking, and code diagnostics.
  • Custom Tooling: Developers can leverage Roslyn APIs to build custom tools, code analyzers, and code generators.
  • Open Source: Roslyn is an open-source project, enabling community contributions and continuous improvement.
  • Language Services: Roslyn provides language-specific services, such as syntax trees, semantic analysis, symbol resolution, and code generation.
  • Compiler as a Service (CaaS): Roslyn introduces the concept of Compiler as a Service, allowing developers to interact with the compiler at runtime.

 

Code Execution: CLR vs Core CLR

Code Execution difference in .Net Core and .Net Framework

.NET Framework: The .NET Framework is a full-featured framework that relies on the Common Language Runtime (CLR) to execute code. It includes a Just-In-Time (JIT) compiler that converts Intermediate Language (IL) code into machine code at runtime. The compiled code is then executed by the CLR.

.NET Core: .NET Core, on the other hand, uses a different approach for code execution. It employs the .NET Core Runtime (CoreCLR), which is a modular and cross-platform runtime. The CoreCLR includes a Just-In-Time compiler and supports ahead-of-time (AOT) compilation, where the IL code can be compiled into machine code before execution.

0 Comments

Related Posts

Delegates in C#: Complete tutorial

Learn Delegates c# In C#, a delegate is a type that represents references to methods with a particular parameter list and return type. Delegates provide a way to encapsulate a method, and they are often used for defining callback methods and implementing event...

Inheritance in C# oops complete guide

Inheritance Table of content: Topics1Why i wrote this article2Inheritance - complete guide3All possible scenarios based/ tricky in/out type of Interview questions Why i wrote this article? When I was preparing c#/oops, the main challenge was information was scattered...

Learn Angular Directives

Angular Directives Angular directives are an essential part of the Angular framework, allowing you to extend the HTML vocabulary to build dynamic and interactive web applications. There are three main types of directives in Angular: Components: Components are the most...

.Net Core Garbage Collector

Garbage collection   Garbage collection (GC) in .NET Core is an automatic memory management technique that reclaims unused memory. It simplifies memory management for developers and reduces memory leaks and bugs.   The GC identifies and collects objects that...

Most Useful Git Commands

Git commands you should know: git init: Initializes a new Git repository in the current directory. git clone [repository_url]: Creates a copy of a remote repository on your local machine. git add [file]: Stages changes for commit. You can use git add . to stage all...

.Net Core Introduction

INTRODUCTION .NET Core is a modern, cross-platform, and open-source development platform developed and maintained by Microsoft. It provides developers with a fast, flexible, and modular framework for building applications for Windows, Linux, macOS, iOS, and Android....

Delegates in C#: Complete tutorial

Learn Delegates c# In C#, a delegate is a type that represents references to methods with a particular parameter list and return type. Delegates provide a way to encapsulate a method, and they are often used for defining callback methods and implementing event...

Inheritance in C# oops complete guide

Inheritance Table of content: Topics1Why i wrote this article2Inheritance - complete guide3All possible scenarios based/ tricky in/out type of Interview questions Why i wrote this article? When I was preparing c#/oops, the main challenge was information was scattered...

Learn C# oops Polymorphism

Polymorphism Simplifying Polymorphism in C# with Examples Polymorphism is a fundamental concept in object-oriented programming (OOP), and it can be understood more easily by breaking it down into its key components. What is Polymorphism? At its core, polymorphism...

Learn Angular Directives

Angular Directives Angular directives are an essential part of the Angular framework, allowing you to extend the HTML vocabulary to build dynamic and interactive web applications. There are three main types of directives in Angular: Components: Components are the most...

.Net core Fun FACTS to choose other backend but NOT .Net Core

Funny Excuses to Avoid Learning and Using .NET Core for Your Next Backend Web API (And Why You Should Consider Node.js and Other Popular Alternatives Instead) In the world of backend web development, there are numerous technologies to choose from. One option that...

.Net Core Garbage Collector

Garbage collection   Garbage collection (GC) in .NET Core is an automatic memory management technique that reclaims unused memory. It simplifies memory management for developers and reduces memory leaks and bugs.   The GC identifies and collects objects that...

Most Useful Git Commands

Git commands you should know: git init: Initializes a new Git repository in the current directory. git clone [repository_url]: Creates a copy of a remote repository on your local machine. git add [file]: Stages changes for commit. You can use git add . to stage all...

Commonly used commands for .net Core Good to remember

Most userful commands for .net Core. Good to remember. dotnet new: This command is used to create a new project based on a specified template. It generates the basic structure and files required for a .NET Core application. Example: dotnet new console dotnet clean:...

.Net Core Introduction

INTRODUCTION .NET Core is a modern, cross-platform, and open-source development platform developed and maintained by Microsoft. It provides developers with a fast, flexible, and modular framework for building applications for Windows, Linux, macOS, iOS, and Android....

.Net Framework Basics CLR CTS CTS MSIL

CLR (Common Language Runtime) Responsible for program execution in .Net Framework Some crucial role of CLR- Memory Management: The CLR is responsible for managing memory allocation and deallocation in .NET applications. It includes automatic memory management through...

Understand Middleware in .Net Core

Middleware is a piece of software that handles http request and response. In simple term, .net core works with middleware in order to enhance performance of our application rather than having big chunk of framework component/ libraries at once, for which most of the...

Learn How .Net Core Hosting Works

Hosting In .NET CoreIn ASP.NET Core, there are two hosting models available: in-process hosting and out-of-process hosting.In-process Hosting (Default): In the in-process hosting model, a single web server (e.g., IIS) is used directly to host the application. To...