See https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-app/
trying to see if i can setup a codespace with .net 10 preview
Fire up a codespace and after it cooks for a bit give it a go in a terminal with dotnet run hello.cs
or dotnet run app.cs
install the C# Dev Kit and then follow these instructions to update the C# extension for file-based apps support: To enable support for file-based apps and directives, you’ll need the latest pre-release version of the C# extension:
Open the Extensions sidebar (Ctrl+Shift+X) Search for “C#” In the extension page, click the Switch to Pre-Release Version button Ensure the version installed is at least 2.79.8