Setting Up Your Machine

This page walks through each install in more detail than the Prerequisites checklist.

.NET 10 SDK

  1. Download the .NET 10 SDK installer for your operating system from dotnet.microsoft.com. Choose the SDK, not the runtime.
  2. Run the installer.
  3. Open a new terminal (PowerShell, Command Prompt, or a shell) and confirm:

    dotnet --list-sdks
    output
    10.0.100 [C:\Program Files\dotnet\sdk]
  4. Trust the HTTPS development certificate so the API runs over https://localhost without warnings:

    dotnet dev-certs https --trust

EF Core tools

Module 2 uses the EF Core command-line tools to create migrations. Install them once as a global tool:

dotnet tool install --global dotnet-ef
dotnet ef --version

Editor

Any of these work well for the workshop. Choose the one you already know.

Install the ASP.NET and web development workload. .http files open in the built-in HTTP editor with a Send Request link above each request.

Install the C# Dev Kit extension. For .http files, install REST Client (by Huachao Mao). Optionally add SQLite Viewer to inspect the database.

Rider includes C# support and an HTTP client for .http files out of the box.

Git and the workshop repo

git clone https://github.com/cwoodruff/aspnet-minimal-api-workshop.git
cd aspnet-minimal-api-workshop
git tag

You should see start and checkpoint-1 through checkpoint-5. These tags are the backbone of the day:

  • start is the empty starter, identical to the src/00-start project. Begin here.
  • checkpoint-N is the code exactly as it stands at the end of Lab N.

During the day, if you fall behind or something breaks that you cannot fix in a minute, jump to the nearest checkpoint and keep going with the group:

git stash            # optional: keep your work to look at later
git checkout checkpoint-2

When you want to return to the branch you were building on, git switch - takes you back.

The source layout

Everything you run during the day lives under src/, described in src/README.md:

Project What it is
Roastery.Api The API you build all day
Roastery.Payments A fake payment provider that fails ~30% of requests on purpose (Module 4)
Roastery.Tests Integration tests (Module 4)
Roastery.AppHost, Roastery.ServiceDefaults .NET Aspire orchestration (Module 5)
00-start A frozen copy of the starting point for the environment check

The .http request files for each module are in the http/ folder at the repo root.

Verify the whole thing builds

From the start tag (or any checkpoint), a full restore and build confirms your SDK and packages are healthy:

git checkout checkpoint-5     # the finished solution
dotnet build src/Roastery.slnx
dotnet test  src/Roastery.Tests

You should see a successful build and four passing tests. Then run the finished API to see where the day is headed:

dotnet run --project src/Roastery.Payments    # https://localhost:7281
dotnet run --project src/Roastery.Api         # https://localhost:7181

Browse to https://localhost:7181/scalar/v1 for the API document, and sign in with a seed account (listed in src/README.md, e.g. barista@roastery.dev / Barista1!). When you are done exploring, git switch - returns you to your own branch.

Module 5 builds an OCI image with dotnet publish and runs it locally. Install Docker Desktop or Podman and confirm the daemon is running:

The .NET Aspire AppHost also uses a container runtime when you swap in a Postgres resource during the Module 5 stretch goal.

.NET Aspire

Module 5 uses .NET Aspire for local orchestration and the dashboard. The Aspire packages restore with the rest of the solution, but building and running the AppHost additionally needs the Aspire CLI (the dashboard and orchestrator bundle). Install it once:

curl -sSL https://get.aspire.dev | bash
aspire --version
iex "& { $(irm https://get.aspire.dev/install.ps1) }"
aspire --version

To pre-cache the Aspire packages before the day, restore the finished solution once:

git checkout checkpoint-5
dotnet restore src/Roastery.slnx

The other four projects (API, Payments, Tests, ServiceDefaults) build and run without the Aspire CLI, so you can complete most of Module 5 even if this install gives you trouble; only running the AppHost and its dashboard depends on it.

A lifeboat

If corporate policy blocks downloads on your laptop, ask the instructor at the start of the day. A shared drive with the SDK installers and a zipped copy of the repo is available in the room.