Scaffold a new C# class, record, or interface from the VS Code explorer
Adjust namespaces across a folder when reorganizing a C# project
Generate a CRUD ASP.NET controller wired to a DbContext
Extract an interface from a class or sort using directives in one click
Just install from the VS Code marketplace; no extra config needed for the basic scaffolds.
CSharp Painkiller is a Visual Studio Code extension aimed at people writing C# code. VS Code is a free code editor from Microsoft, and an extension adds extra menu items and shortcuts to it. This particular extension tries to reduce the small repetitive tasks that come up when working on C# projects, so the name is a nod to taking away pain. The main feature is creating new C# type files. You right-click a folder in the explorer and pick C# Create, and it scaffolds a class, record, struct, enum, interface, or record struct with the correct namespace already filled in. Related to that, there is an Adjust Namespaces action that fixes namespace declarations across one file or a whole folder, and a Rename File By Type action that renames a .cs file so its name matches the type inside it. The refactor menu also includes a one-click Extract Interface from a class, a Generate Mapping Methods option that writes MapTo and MapFrom boilerplate between two types, and a Sort Usings action that alphabetises the using directives at the top of files. For people building web APIs, there are generator templates for ASP.NET controllers and Minimal API endpoints, including full CRUD versions wired to a DbContext. There are also templates for MediatR and MitMediator (libraries for the request and handler pattern), covering requests, handlers, notifications, and pipeline behaviors. Entity Framework Core entity configurations can be scaffolded too. Finally, the extension shows real-time inline diagnostics for things like a wrong namespace, a filename that does not match the primary type, unsorted using directives, and mixed-script identifier names. Each one can be turned on or off in settings.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.