No history yet

Introduction to .NET Framework

What is .NET?

The .NET Framework is a software development platform created by Microsoft in the early 2000s. Its main job is to provide a consistent environment for developers to build and run applications, especially for Windows. Before .NET, developing for Windows often meant using different, sometimes incompatible, technologies. Microsoft wanted to simplify this process with a single, unified platform.

Think of it as a foundational layer that sits on top of the operating system. It handles many of the complex, low-level tasks so developers can focus on building features.

Over the years, .NET has evolved significantly. It started as the .NET Framework, which was tied to Windows. More recently, Microsoft introduced .NET Core (now just called .NET), a modern, open-source, and cross-platform version that runs on Windows, macOS, and Linux. For now, we'll focus on the original framework that started it all.

Core Design Principles

Microsoft built .NET around a few key ideas that made it powerful and flexible.

Language Independence: One of the most powerful features of .NET is that it isn't tied to a single programming language. Developers can use C#, F#, or Visual Basic, and the code from each language can work together seamlessly within the same project. This is possible because all .NET languages compile to a common intermediate language.

Interoperability: At the time of its creation, many businesses had existing software built with older technologies like COM (Component Object Model). .NET was designed to interact with these legacy systems easily. This made it much easier for companies to adopt the new framework without having to rewrite all their old code.

Memory Management: In older languages like C++, developers had to manually manage how their program used computer memory. This was tedious and a common source of bugs called "memory leaks." .NET introduced automatic memory management. A component called the Garbage Collector runs in the background, automatically cleaning up memory that's no longer being used. It's like having a self-cleaning kitchen—you can focus on cooking without worrying about the cleanup.

A Look at the Architecture

The .NET Framework has a layered architecture. At the bottom, you have the computer hardware and the operating system. The .NET Framework sits on top of this, providing a platform for applications to run.

Lesson image

The two most important components of this architecture are the Common Language Runtime (CLR) and the Framework Class Library (FCL).

The Common Language Runtime (CLR) is the execution engine of .NET. It manages the code at runtime, handling tasks like memory management (the Garbage Collector lives here), security, and converting the intermediate language into machine code that the computer's processor can understand.

The Framework Class Library (FCL) is a huge collection of reusable code that developers can use to perform common tasks. Need to connect to a database, read a file, or create a web page? There's code in the FCL for that. It's like a massive, well-organized toolbox that saves developers from having to build everything from scratch.

Understanding the framework’s architecture, including Common Language Runtime (CLR), .NET class library, and application domains, is critical to your interview preparation.

Together, these components create a managed environment where applications are built and executed, providing a balance of power and simplicity for developers.