thread-abort-migration

Installation
SKILL.md

Thread.Abort Migration

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.

When to Use

  • Migrating a .NET Framework project to .NET 6+ that calls Thread.Abort
  • Replacing ThreadAbortException catch blocks that use control flow or cleanup logic
  • Removing Thread.ResetAbort calls that cancel pending aborts
  • Replacing Thread.Interrupt for waking blocked threads
  • Migrating ASP.NET code that uses Response.End or Response.Redirect(url, true), which internally call Thread.Abort
  • Resolving PlatformNotSupportedException or SYSLIB0006 warnings after a target framework change

When Not to Use

  • The code only uses Thread.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.
  • The project will remain on .NET Framework indefinitely
  • The Thread.Abort usage is inside a third-party library you do not control
Related skills
Installs
3
GitHub Stars
371
First Seen
Apr 11, 2026