.NET 8 and 9 are out of support: find every straggler, retarget to net10.0, and let the new warnings be the worklist
A short audit script, one retarget, and the two obsolete-API warnings that appear only on .NET 10. Fifteen minutes, any coding agent.

On 10 November 2026, .NET 8 and .NET 9 reached end of support, according to the .NET 11 announcement
. Microsoft’s support policy page
lists .NET 10 as supported until 14 November 2028. If a service of yours still says net8.0, it’s now getting no security fixes, and the retarget is a one-afternoon job with a clear finish line.
The finish line is the hard part to see. A TargetFramework edit is the visible part. The rest is a global.json that refuses the new SDK, a Dockerfile base image, a CI step that installs the old runtime, and a library that multi-targets both versions. An agent asked to “upgrade to .NET 10” tends to fix the csproj it finds first and call it done.
So the plan is to take the search away from the agent. A script lists every place a repo still names .NET 8 or 9 and exits non-zero while any remain. The agent works until the script is quiet and the build is clean. The same loop works with any coding agent that can read files and run a shell, because the only things it relies on are a script and a compiler.
The audit script
This Python script (3.8 or later, standard library only) scans project files, props files, global.json, Dockerfiles and YAML for the old versions.
#!/usr/bin/env python3
"""List every place a repo still names .NET 8 or 9. Usage: dotnet_eol_audit.py [root]"""
import pathlib, re, sys
OLD = re.compile(r"\bnet(?:8|9)\.0(?:-[a-z]+[\w.-]*)?\b|\b(?:8|9)\.0(?:\.\d+|\.x)\b|dotnet/(?:sdk|aspnet|runtime):(?:8|9)\.0|\"version\"\s*:\s*\"(?:8|9)\.")
GLOBS = ["**/*.csproj", "**/*.fsproj", "**/*.props", "**/*.targets", "**/global.json",
"**/Dockerfile*", "**/*.yml", "**/*.yaml"]
SKIP = {"bin", "obj", "node_modules", ".git"}
root = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else ".")
hits = 0
for pattern in GLOBS:
for path in sorted(root.glob(pattern)):
if SKIP & set(path.parts):
continue
for n, line in enumerate(path.read_text(errors="ignore").splitlines(), 1):
if OLD.search(line):
hits += 1
print(f"{path.relative_to(root)}:{n}: {line.strip()}")
print(f"{hits} line(s) still name .NET 8 or 9")
sys.exit(1 if hits else 0)
Here’s a small test repo that has the usual stragglers: an API on net8.0, a library multi-targeting net8.0;net9.0, a global.json pinned to 8.0.100, a two-stage Dockerfile and a CI file that installs both runtimes. Run the script and it prints:
src/Api/Api.csproj:4: <TargetFramework>net8.0</TargetFramework>
src/Core/Core.csproj:3: <TargetFrameworks>net8.0;net9.0</TargetFrameworks>
global.json:1: { "sdk": { "version": "8.0.100", "rollForward": "latestFeature" } }
src/Api/Dockerfile:1: FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
src/Api/Dockerfile:5: FROM mcr.microsoft.com/dotnet/aspnet:8.0
.github/workflows/ci.yml:7: 8.0.x
.github/workflows/ci.yml:8: 9.0.x
7 line(s) still name .NET 8 or 9
Seven lines in four kinds of file. Only two of them are the ones people remember.
The regex is deliberately blunt. It will flag a comment that mentions net8.0, and it won’t see a version passed in through a build argument or a variable in a reusable workflow. Treat a clean run as “no literal mentions left”, then search for the build args by hand.
The global.json trap
Install only the .NET 10 SDK on a machine and build the untouched repo, and the build never starts:
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application 'build' does not exist or is not a managed .dll or .exe.
* You intended to execute a .NET SDK command:
A compatible .NET SDK was not found.
Requested SDK version: 8.0.100
global.json file: ./global.json
The message is accurate, but it reads like a broken install, and an agent that sees it may start trying to install SDK 8. The rollForward policy doesn’t help here: latestFeature rolls forward through feature bands inside the same major.minor, and 8.0.100 can’t land on 10.x. Change the file to 10.0.100. Per the setup-dotnet docs
, a rollForward policy needs a fully qualified sdk.version such as that one, and wildcards aren’t supported.
Do this edit yourself, or tell the agent about it in the prompt. It’s the one edit that produces a misleading failure.
Retarget, then read the warnings
The order matters. Build once on the old target frameworks with the new SDK, save the warnings, retarget, build again, and compare. On the test repo, the library has two lines of code that use cryptography APIs:
using System.Security.Cryptography.X509Certificates;
namespace Core;
public static class Certs
{
public static X509Certificate2 Load(byte[] raw) => new X509Certificate2(raw);
public static string Hash(string pw, byte[] salt) =>
Convert.ToHexString(new System.Security.Cryptography.Rfc2898DeriveBytes(pw, salt, 1000).GetBytes(8));
}
Built for net8.0 it produces one warning, the older SYSLIB0041 about the default hash algorithm and iteration count in Rfc2898DeriveBytes constructors. Retarget everything to net10.0 and it produces a different set:
src/Core/Certs.cs(5,56): warning SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[])' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.'
src/Core/Certs.cs(7,29): warning SYSLIB0060: 'Rfc2898DeriveBytes.Rfc2898DeriveBytes(string, byte[], int)' is obsolete: 'The constructors on Rfc2898DeriveBytes are obsolete. Use the static Pbkdf2 method instead.'
Two new warnings, and neither is a compile error, so a build that only checks “did it succeed” passes. That is the reason to read warnings during a framework move: they are the compiler listing the APIs the new version wants you off. The SYSLIB0057 page
says the byte-array and file-path constructors have been obsolete since .NET 9, and the SYSLIB0060 page
says every Rfc2898DeriveBytes constructor is obsolete starting in .NET 10. Code that skipped .NET 9 sees both at once.
The fix that changes stored data
Both replacements are mechanical. X509CertificateLoader.LoadCertificate(raw) replaces the constructor for X.509 content (PKCS12 content has its own LoadPkcs12 methods, so check what the file really is). Rfc2898DeriveBytes.Pbkdf2 replaces the instance and GetBytes.
The second one has a catch, and it’s the kind an agent walks into. The old three-argument constructor hashes with SHA-1. The static method has no default, so the agent has to choose an algorithm, and the “secure” choice is SHA-256. That silently changes every derived value, so passwords hashed under the old code no longer verify.
Here’s the replacement with the algorithm made explicit:
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace Core;
public static class Certs
{
public static X509Certificate2 Load(byte[] raw) => X509CertificateLoader.LoadCertificate(raw);
public static string Hash(string pw, byte[] salt, HashAlgorithmName alg) =>
Convert.ToHexString(Rfc2898DeriveBytes.Pbkdf2(pw, salt, 1000, alg, 8));
}
Run the old code on the .NET 8 runtime and the new code on .NET 10, with the same password and an all-zero salt:
old (net8.0):
387F729CB6653898
new (net10.0):
SHA1 387F729CB6653898
SHA256 1AFE039370719A38
SHA-1 reproduces the old value exactly. SHA-256 doesn’t. For a migration the right move is to keep SHA-1 verification working and re-hash to something stronger when a user next logs in, which is a design decision for you and not a thing to leave to a find-and-replace. Say so in the prompt (below) so the agent stops and asks.
With both warnings fixed, dotnet build -warnaserror finishes with 0 errors.
The prompt
This prompt is agent-neutral. It’s the whole job, and it depends on the audit script and the compiler, not on any one tool:
Goal: move this repo from .NET 8/9 to net10.0.
1. Run `python3 tools/dotnet_eol_audit.py .` and fix every line it prints:
target frameworks, global.json (set sdk.version to a full 10.0.x version),
Dockerfile base image tags, and CI dotnet-version entries.
2. Before retargeting, run `dotnet build --no-incremental` with the
new SDK and save the warning list to a file. After retargeting, build again
and show me the warnings that are new.
3. Fix each new warning with the replacement the warning names. If the
replacement changes output (hashes, serialised data, certificate loading
behaviour), stop and ask before choosing a value.
4. Finish only when the audit script exits 0, `dotnet build -warnaserror`
passes and the tests pass. Do not delete or skip a test.
Step 2 is the part agents skip. Without the “before” list, a warning that was already there looks like a new one and gets “fixed” in the same commit as the retarget, which makes the diff harder to review.
CI and the Dockerfile
The CI file is the easiest place to lose the thread. Reading the SDK version from global.json means it can’t drift from the local one:
- uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
- run: dotnet test
Per the setup-dotnet README, v6 is the current major tag and global-json-file is an accepted input. With that in place the audit script stops finding 8.0.x lines in the workflow, and the CI SDK always matches the one in the repo.
In the Dockerfile, change the SDK and ASP.NET base image tags in step with the project. The audit script exits non-zero until that’s done. The image build itself wasn’t run for this article, so check the tag names you pick against the image registry before merging.
Make it yours
Libraries that other teams consume are a different case. Dropping net8.0 from a multi-targeted package forces every consumer to move first, so keep the old target until they have. The audit script will still flag it, so add an allow-list entry (a # audit: keep marker and a one-line check in the script) instead of leaving a red job.
If the repo stays on a pinned SDK for reproducible builds, keep rollForward at latestFeature and bump 10.0.100 with each SDK band you adopt. And if you’d rather go straight to .NET 11, the same loop applies: change the target and the audit regex, and rerun. The announcement lists both as supported options.
What goes wrong
The audit finds text, not intent. A net8.0 inside a comment, a changelog or a test fixture is a false positive, and a version assembled from variables is a false negative. The warnings comparison only sees APIs your code calls directly, so a transitive package that targets net8.0 only will show up as a restore warning or a runtime failure, not here.
A retarget also doesn’t prove behaviour. Run the tests, and if coverage is thin on the area the warnings pointed at (cryptography, serialisation, certificates), write the characterisation test before the agent touches it.
First 15 minutes
Save the script as tools/dotnet_eol_audit.py, run it from the repo root, and count the lines. Then change global.json yourself, build with the old target frameworks, save the warning list, and hand the rest to the agent with the prompt above.