Unveiling .NET Secrets with the World's Smallest C# Program
summary
Creates a two‑character C# file "{}" and compiles it via the Roslyn CSC invoked through dotnet to produce a DLL and PDB, runs to ExitCode 0 after adding a runtimeconfig.json. Uses DotPeek to show the compiler-generated Program.Main, inspects the 12 bytes of IL in a hex editor, watches hostfxr → hostpolicy.dll → coreclr load with WinDbg, observes 42 strings on the heap and JIT output for tiered compilation, and traces file operations with ProcMon; demos all tools successfully. top-level statements
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:05Understanding .NET assemblies
- 3:51JIT and tiered compilation
- 8:21Compiling C# with Roslyn
- 13:19Framework vs self-contained apps
- 18:15Exploring DLL with dotPeek
- 23:51Decompiling IL to C#
- 27:02Inspecting DLL bytes
- 33:17Debugging with WinDbg
- 41:22Monitoring with ProcMon
- 47:03Creating projects
- 50:13Building with MSBuild
- 57:10Runtime launch with apphost
related talks
01h 05mFrom 'dotnet run' to 'Hello World!'
01h 02mSo you want to create your own .NET runtime?
53mSo you want to create your own .NET runtime?
49mFrom 'dotnet run' to 'Hello World!'
01h 00mC# Language Internals
56mHacking .NET(C#) Applications: The Black Arts (ASM attacks)
01h 01mHidden gems in .NET Core 3
39mRunning .NET on the NES
