Framework-dependent deployment produces a smaller output that relies on the target machine having the matching .NET runtime already installed. Self-contained deployment bundles the entire .NET runtime alongside the application, producing a larger output that can run on a machine with no .NET installed at all, at the cost of increased size and needing separate builds per target OS/architecture.
A SaaS company distributing a desktop agent to customer machines uses self-contained deployment so customers don't need to separately install any .NET runtime, simplifying the installation experience.
Likely follow-ups
What does the -r (runtime identifier) flag control?
How does self-contained deployment interact with trimming to reduce size?
Native AOT compiles a .NET application directly to native machine code at publish time, producing a fully self-contained native executable with no JIT compilation or full .NET runtime required at startup -- resulting in dramatically faster startup time and lower memory footprint, ideal for CLI tools, containers, and serverless functions. Constraints include no runtime reflection-based dynamic code generation, limited support for some libraries, and platform-specific builds required per target.
dotnet publish -c Release -r linux-x64 -p:PublishAot=true
# Produces a native executable with no separate .NET runtime dependency,
# starting in milliseconds instead of the usual JIT warm-up time
Real-world example
A serverless function deployed to AWS Lambda uses Native AOT to cut cold-start latency from several hundred milliseconds down to under 50ms, directly improving cost and user-perceived performance.
Likely follow-ups
Why doesn't Native AOT support full reflection-based serialization?
How does trimming warning analysis help catch AOT-incompatible code?
`dotnet add package <PackageId>` adds a PackageReference to the .csproj (optionally with --version), `dotnet remove package <PackageId>` removes it, and `dotnet list package` shows all references, including outdated or vulnerable packages with the --outdated or --vulnerable flags.
A security audit runs `dotnet list package --vulnerable` across every project in a solution as part of a scheduled CI job to catch known CVEs in third-party dependencies before they reach production.
Likely follow-ups
How does --outdated differ from --vulnerable in its data source?
How do you restore packages from a private NuGet feed?
`dotnet watch run` monitors source files for changes and automatically rebuilds and restarts (or hot-reloads, when possible) the application, eliminating the manual stop-edit-rebuild-restart cycle during active development. It supports Hot Reload for many code changes without a full restart, preserving application state where feasible.
dotnet watch run
# Edit a .cs file and save --
# the app automatically rebuilds and either hot-reloads or restarts
Real-world example
A developer building an ASP.NET Core API uses `dotnet watch run` throughout the day, seeing most controller and service changes reflected within a couple of seconds without manually restarting the server.
Likely follow-ups
What kinds of code changes support Hot Reload versus requiring a full restart?
How does dotnet watch differ from IDE-integrated hot reload?
A <ProjectReference> points to another project's .csproj file within the same solution/repository, letting MSBuild automatically determine build order (dependencies built first) and always use the latest local source rather than a published NuGet package. This is preferred during active co-development of related projects, while PackageReference is used for external or independently versioned/released dependencies.
<ItemGroup>
<ProjectReference Include="..\MyLib\MyLib.csproj" />
</ItemGroup>
<!-- MSBuild automatically builds MyLib first, then this project -->
Real-world example
A solution with an API project and a shared Models class library uses a ProjectReference so any change to Models is immediately reflected in the API build without needing to publish and consume an internal NuGet package.
Likely follow-ups
When should an internal library be published as a NuGet package instead of referenced directly?
How does circular project reference detection work?