6. Framework
"Code that targets the runtime is known as managed code, while code that doesn't target the runtime is known as unmanaged code."1
"With managed code, the compiler does not generate the machine code that the CPU executes. Instead, the compiler produces a form of binary code called the intermediate language (IL). The executable binary is produced later, usually, although not always, at runtime. The use of IL enables features that are hard or even impossible to provide under the more traditional model."2
The approach is quite similar to Java with its byte code for the JVM.
6.1 Assemblies
"Assemblies are the fundamental units of deployment, version control, reuse, activation scoping, and security permissions for .NET-based applications. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. Assemblies take the form of executable (.exe) or dynamic link library (.dll) files, and are the building blocks of .NET applications. They provide the common language runtime with the information it needs to be aware of type implementations."3
6.2 Solutions and Projects
C# organizes it projects in solutions. A good association for a solution is an application. An application may consist of a backend with a REST API and one or more front end clients and additional programs. A solution holds one or more projects. Each project is either a library or a running program.
6.3 Package Manager NuGet
NuGet is npm in the .net world, i.e. a package manager.
6.4 IDE & .Net Version
We use
- .Net 8 and hence C# 12
You may use one of the following IDEs
- Visual Studio, Visual Studio for Mac is scheduled for retirement on August 31, 2024
- Rider (free for students)
- VS Code, has fewer functions regarding code inspection and refactoring.
I will use Rider on Windows for Avalonia apps and Visual Studio Community for MAUI (hot reload for MAUI seems to work with Rider and Mac, but not with Rider and Windows).
-
Gewarren. Overview of .net framework - .net framework. 2024. URL: https://learn.microsoft.com/en-us/dotnet/framework/get-started/overview (visited on 29.02.2024). ↩
-
Ian Griffiths. Programming C# 10: Build cloud, web, and desktop applications. O'Reilly Media Inc, Sebastopol, CA, first edition edition, 2022. ISBN 9781098117788. URL: https://learning.oreilly.com/library/view/programming-c-10/9781098117801. ↩
-
David Pine. Assemblies in .net - .net. 2024. URL: https://learn.microsoft.com/en-us/dotnet/standard/assembly/?source=recommendations (visited on 29.02.2024). ↩