Run a C# File Without a Project: dotnet run app.cs in .NET 10
Since .NET 10, you can run a C# file with no project at all. Type dotnet run file.cs (here, dotnet run app.cs) and the SDK builds and runs that one file. This three-line app.cs is the whole program: Output of dotnet run app.cs: I tested everything below on Windows 11 with SDK 10.0.402: NuGet packages, … Read more >>