A minimal .NET 10 console app that can be built, run, debugged, tested, and published as native executables for macOS and Windows from macOS or Windows using VS Code and Make.
app/src: primary C# console app (positioned here so additional stacks like Python or Node can live alongside later).tests/HelloWorld.Tests: xUnit test project validating the shared logic.publish: output folder populated by the Makefile publish targets.
- .NET SDK 10.0.101 (project targets net10.0; update
global.jsonif you install a different SDK) - VS Code with the official C# extension
makeavailable in your shell (preinstalled on macOS, available through WSL or Git Bash on Windows)
make restoreThis restores NuGet packages for both the app and the test project.
| Command | Purpose |
|---|---|
make build |
Build the console app in Debug mode |
make run |
Build and run the app |
make test |
Run the xUnit test project (prints a reminder if the test project is removed) |
make clean |
Clean build artifacts and publish output |
make publish-macos |
Produce a self-contained, single-file macOS ARM64 binary in publish/macos |
make publish-windows |
Produce a self-contained, single-file Windows x64 binary in publish/windows |
make publish-linux-arm |
Produce a self-contained, single-file Linux ARM64 binary in publish/linux |
make publish |
Publish for macOS, Windows, and Ubuntu/Linux |
All make targets operate on app/src/cstest.csproj via the PROJECT variable. If you rename or relocate the project again, run make build PROJECT=relative/path/to.csproj or update the default in the Makefile.
You can override defaults, for example:
make build CONFIG=Release
make publish-macos RUNTIME_OSX=osx-x64dotnet: buildanddotnet: runtasks are defined in .vscode/tasks.json.- The
.NET Launchconfiguration in .vscode/launch.json uses the build task before debugging so it works on both macOS and Windows without further setup. - Tests and publish tasks are also available through the VS Code task runner (⇧⌘B / Ctrl+Shift+B).
The Makefile uses dotnet publish with --self-contained true, -p:PublishSingleFile=true, and -p:UseAppHost=true so the generated binaries do not require a shared runtime and satisfy the .NET single-file requirements.
- macOS output:
publish/macos/cstest - Windows output:
publish/windows/cstest.exe - Linux ARM output:
publish/linux/cstest(defaults tolinux-arm64)
Adjust RUNTIME_OSX, RUNTIME_WIN, or RUNTIME_LINUX if you need different architectures (for example osx-x64, win-arm64, linux-x64).
A lightweight xUnit project lives under tests/HelloWorld.Tests and verifies the message builder logic. Run it with make test or the dotnet: test VS Code task.
- If
dotnetis missing or you have a different SDK installed, either install 10.0.101 or adjustglobal.jsonto the version you have before rerunningmake restore. - Update the
programpath in.vscode/launch.jsonif you rename the project folder, since the DLL name matches the folder name. - Platform-specific setup tips for Windows/Linux (extra PATH entries, drive mapping, etc.) now live in
.github/copilot-instructions.mdto keep this README lean.