Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides migration of .NET Framework Thread.Abort code to cooperative cancellation for .NET 6 and later.
64% 84%+20 ptsof test cases passed
Passed 21 of 25 test cases with the skill, and 16 of 25 without it.
A background queue worker in a .NET Framework app calls `ManualResetEvent.WaitOne()` to wait for work items, and the supervisor calls `Thread.Abort()` when stopping the queue. Refactor this blocking wait pattern for modern .NET.
Uses WaitHandle.WaitAny to wait on the signal handle and the cancellation token handle simultaneously.
3 of 3 safety checks passed
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)Next to this one in the catalogue, plus more from the same author.