Install any skill in seconds. Free to start, no credit card required.
Get Started Free →dotnet/thread-abort-migration
Guides migration of .NET Framework Thread.Abort usage to cooperative cancellation in modern .NET. USE FOR: modernizing code that calls Thread.Abort, catching ThreadAbortException, replacing Thread.ResetAbort, replacing Thread.Interrupt for thread termination, resolving PlatformNotSupportedException or SYSLIB0006 after retargeting to .NET 6+, migrating ASP.NET Response.End or Response.Redirect(url, true) which internally call Thread.Abort. DO NOT USE FOR: code that only uses Thread.Join, Thread.S
Passed 21 of 25 test cases with the skill, and 16 of 25 without it.
and 2 more in the full report
5 fixed16 passed either way4 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
Our legacy C# application targets .NET Framework 4.7.2 and uses `Monitor.Enter` and `Monitor.TryEnter` with lock timeout parameters to prevent deadlocks across worker threads. We are upgrading the target framework to .NET 8. Assess this synchronization code and specify if any thread termination or abort migration steps are needed.
| Checked | Without skill | With skill |
|---|---|---|
| States that lock timeout synchronization using Monitor APIs does not require Thread.Abort migration. | Missed | Passed |
The instructions your model reads when the skill loads.
This skill helps an agent migrate .NET Framework code that uses Thread.Abort to the cooperative cancellation model required by modern .NET (6+). Thread.Abort throws PlatformNotSupportedException in modern .NET — there is no way to forcibly terminate a managed thread. The skill identifies the usage pattern first, then applies the correct replacement strategy.
Thread.AbortThreadAbortException catch blocks that use control flow or cleanup logicThread.ResetAbort calls that cancel pending abortsThread.Interrupt for waking blocked threadsResponse.End or Response.Redirect(url, true), which internally call Thread.AbortPlatformNotSupportedException or SYSLIB0006 warnings after a target framework changeThread.Join, Thread.Sleep, or Thread.Start without any abort, interrupt, or ThreadAbortException catch blocks. These APIs work identically in modern .NET — no migration is needed. Stop here and tell the user no migration is required. If you suggest modernization (e.g., Task.Run, Parallel.ForEach), you must explicitly state these are optional improvements unrelated to Thread.Abort migration, and the existing code will compile and run correctly as-is on the target framework.| Input | Required | Description |
|---|---|---|
| Source project or solution | Yes | The .NET Framework project containing Thread.Abort usage |
| Target framework | Yes | The modern .NET version to target (e.g., net8.0) |
| Thread.Abort usage locations | Recommended | Files or classes that reference Thread.Abort, ThreadAbortException, Thread.ResetAbort, or Thread.Interrupt |
Commit strategy: Commit after each pattern replacement so the migration is reviewable and bisectable. Group related call sites (e.g., all cancellable work loops) into one commit.
Search the codebase for all thread-termination-related APIs:
Thread.Abort and thread.Abort() (instance calls)ThreadAbortException in catch blocksThread.ResetAbortThread.InterruptResponse.End() (calls Thread.Abort internally in ASP.NET Framework)test cases passed, vs 16 / 25 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.