Lessons in this course (9)

2. Assemblies, namespaces, NuGet and project structure

Basic★ Must knowLesson 2 of 9
  • Assembly — the unit of deployment and versioning (.dll/.exe) containing IL, metadata and a manifest. No GAC in modern .NET (the GAC exists only in .NET Framework).
  • Namespace — logical grouping of types; one assembly can contain many namespaces and vice versa.
  • NuGet package (.nupkg) — zip with assemblies for one or more target frameworks plus dependencies.
  • Solution (.sln or the newer .slnx) contains projects; a project produces one assembly.
bash
dotnet new sln -n Shop
dotnet new webapi -n Shop.Api
dotnet new classlib -n Shop.Core
dotnet sln add Shop.Api Shop.Core
dotnet add Shop.Api reference Shop.Core
dotnet add Shop.Api package Microsoft.EntityFrameworkCore.SqlServer

Deep dive: how the CLR, JIT, memory and the garbage collector work inside is covered in the .NET Internals: CLR, Memory & GC course.