Sample · Issue #8
.NETRunning C# Without a Project File - File-Based Apps in .NET 10 and C# 14
TL;DR · in 30 seconds
- Run a real C# program from a single .cs file — no .csproj, no obj/ or bin/.
- Add packages and SDK settings with #: directives, then publish as Native AOT.
- When the script grows, convert it to a full project instead of letting it sprawl.
// app.cs — run with: dotnet run app.csConsole.WriteLine("Hello from file-based C#!");