.NET › Assemblies & NuGet

What is an assembly in .NET, and what does it contain?

Beginner

Answer

An assembly is the fundamental unit of deployment and versioning in .NET -- a compiled .dll or .exe file containing IL (Intermediate Language) code, type metadata, and a manifest describing the assembly's identity (name, version, culture) and its references to other assemblies. The CLR loads assemblies at runtime to execute the types and members they define.
// Building a project produces an assembly:
dotnet build
// Output: bin/Debug/net8.0/MyApp.dll -- this is the assembly
Real-world example A shared business-logic library is compiled into MyCompany.Core.dll, an assembly referenced by multiple separate application assemblies (web API, background worker, console tool) without duplicating the source code.

Common follow-ups: What's the difference between a private and shared assembly?;How does the CLR locate assemblies at runtime?