Upgrade your solution
dotnet new hands you a solution and never looks back. dotnet new update updates the template, but the solution you made last month stays exactly as it was, which is how you’d want it. Nobody wants a template rewriting their code while they sleep.
Still, a new release lands on the 1st of each month, and sometimes it has something you want: a package bump, a fix, a better skill for your coding agent. This guide gets it in without a copy-and-paste marathon. Generate the release you started from and the latest one, with the same name and options, and diff the two. That diff is only what the template changed, none of yours. Then git applies it to your solution and merges it with your own changes, the way it merges a branch.
Before you start
Section titled “Before you start”You need the .NET 10 SDK, git, and your solution committed with nothing waiting in git status. If the upgrade goes sideways, git reset --hard puts everything back.
Find your release and options
Section titled “Find your release and options”Every solution made since the January 2027 release has a .lmca.json at the root, recording the release and options that made it:
{ "template": "lmca-graphql", "version": "2027.01.01.412", "options": { "name": "WorksOnMyMachine.Movies", "authorName": "Jane Citizen", "authentication": { "Authority": "https://login.example.com", "Audience": "" } }}Each option is a dotnet new option:
In .lmca.json |
Option |
|---|---|
name |
--name |
authorName |
--authorName |
authentication |
--include-auth, with --authority and --audience from inside it. Leave all three off when it’s null |
Upgrade
Section titled “Upgrade”The commands run from your solution’s folder and put their work in an upgrade folder next to it. Swap in your own version and options from .lmca.json.
-
Generate a copy of the release you started from:
Terminal window dotnet new install CleanGraphQLApi.Template@2027.01.01.412dotnet new cleangraphqlapi --name WorksOnMyMachine.Movies --authorName "Jane Citizen" --include-auth --authority https://login.example.com --output ../upgrade/old --no-restore -
Go back to the latest release and generate a copy of that, with the same options:
Terminal window dotnet new updatedotnet new cleangraphqlapi --name WorksOnMyMachine.Movies --authorName "Jane Citizen" --include-auth --authority https://login.example.com --output ../upgrade/new --no-restore -
Diff the two copies into a patch:
Terminal window git -C ../upgrade diff --no-index --binary --output=template.patch old newAn empty patch means the template hasn’t changed anything that touches your solution. You’re up to date; go and have a coffee.
-
Apply the patch:
Terminal window git apply --3way -p2 ../upgrade/template.patch-p2drops thea/old/andb/new/from the paths in the patch, so they line up with your solution.Files you never touched just take the new version. Files you changed get merged with the template’s changes. Where you both changed the same lines, git leaves conflict markers, exactly like a merge, and
git statuslists the file as both modified. Sort each one out, thengit addit.Git says “Falling back to direct application” for files the template added or removed. That’s fine; there was nothing to merge them with. The patch updates
.lmca.jsontoo, so the next upgrade starts from here. -
Build, test and check the format, as CI would:
Terminal window dotnet builddotnet testdotnet format --verify-no-changes -
Commit, and clear up:
Terminal window git commit -m "Upgrade to template release 2027.02.01.430"Then delete the
upgradefolder. It’s done its job.
Take only what you want
Section titled “Take only what you want”The patch is yours to edit. Skip whole folders with --exclude, or take only some with --include:
git apply --3way -p2 --exclude='.agents/*' ../upgrade/template.patchOne catch: the patch always moves .lmca.json to the new release, so the next upgrade starts from there and won’t offer you the parts you skipped. If you might want them later, keep the patch somewhere, or add --exclude='.lmca.json' and stay on the old release until you’ve taken the lot.
Or open template.patch and read it first. Anything in src/Application and src/Infrastructure is the same in all five templates, so a fix there is usually worth having. Anything in src/Presentation is the API itself, where your own changes most likely live.
Coding agents are good at this. Ask yours to apply the patch, resolve the conflicts so it keeps your changes and the template’s, and run the checks. It works as Jacques, so it already knows those checks from AGENTS.md.
What changed in each release
Section titled “What changed in each release”Each release’s notes on GitHub link here. Each release gets a few lines below on what’s worth bringing in and anything that needs care, newest first.
2026.12.02.245
Section titled “2026.12.02.245”The release we launched with. Solutions made from it don’t have a .lmca.json; see Find your release and options.