# Fundamentals

{% embed url="<https://learn.microsoft.com/en-us/dotnet/fundamentals/>" %}

## .NET Components

### Common Language Runtime (CLR)

#### Common Type System (CTS)

The *common type system* defines how types are declared, used, and managed in the common language runtime, and is also an important part of the runtime's support for cross-language integration.

It is designed as a singly rooted object hierarchy with `System.Object` as the base type from which all other types are derived.&#x20;

All types in .NET are either ***value*** types or ***reference*** types.

* ***Value Types:*** Contain the values that need to be stored directly on the stack or allocated inline in a structure. They can be built-in (standard primitive types), user-defined (defined in source code) or enumerations (sets of enumerated values that are represented by labels but stored as a numeric type).

> **Value** types are data types whose objects are represented by the object's actual value. If an instance of a value type is assigned to a variable, that variable is given a fresh copy of the value.

* ***Reference Types:*** Store a reference to the value‘s memory address and are allocated on the heap. Reference types can be any of the pointer types, interface types, or self-describing types (arrays and class types such as user-defined classes, boxed value types, and delegates).

> **Reference** types are data types whose objects are represented by a reference (similar to a pointer) to the object's actual value. If a reference type is assigned to a variable, that variable references (points to) the original value. No copy is made.

#### Common Language Specification (CLS)

The *common language specification* defines a set of features that are needed by many common applications.

CLS is a subset of the CTS. This means that all of the rules in the CTS also apply to the CLS, unless the CLS rules are more strict.

#### Framework Class Libraries (FCL)

### Base Class Libraries (BCL)

{% embed url="<https://endjin.com/blog/2022/07/understanding-the-stack-and-heap-in-csharp-dotnet>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dailyjournal.gitbook.io/notes/multi-platform-frameworks/.net/fundamentals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
