Nifty C# Templates
New C# class, interface, record, enum, test and controller files with the right namespace, plus namespace syncing.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Features




- Right-click → New C# → Class (or Interface, Record, Enum) in the Explorer, type a name, done.
- The namespace is always right. It's built from the nearest project's
RootNamespace (or the project name) plus the folder path: a file in Shop.Api/Services/Billing gets namespace Shop.Api.Services.Billing;.
- Modern by default. File-scoped namespaces (
namespace X;) for .NET 6+ and C# 10+, block namespaces for older projects.
- More templates under New C# File…: record struct, struct, static class, abstract class, exception (with the three standard constructors), xUnit test class, NUnit test class and ASP.NET Core API controller.
- Naming conventions applied.
repository becomes IRepository for interfaces, NotFound becomes NotFoundException, Orders becomes OrdersController, and Calculator becomes CalculatorTests.
- Sync Namespace with Folder. Moved files around? Right-click a file or folder to fix every namespace to match its location.
- Works without C# Dev Kit, including in Cursor, Windsurf and VSCodium.
- Works in the browser on vscode.dev and github.dev.
Commands
| Command |
What it does |
New C# Class… / Interface… / Record… / Enum… |
Create that file in the selected folder |
New C# File… |
Pick from all 12 templates |
Sync Namespace with Folder |
Fix the namespace of a file, or every .cs file in a folder |
Settings
| Setting |
Default |
What it does |
nifty.csharp-templates.namespaceStyle |
auto |
auto, fileScoped or block |
Indentation follows your C# editor settings.
Install
- VS Code: search for "Nifty C# Templates" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Privacy
This extension collects no telemetry, needs no account and makes no network requests.
- Nifty .NET Explorer: Solution & Test Explorer: A solution explorer and test explorer for .NET in VS Code, Cursor, Windsurf and VSCodium: projects, references and files from .sln/.slnx, and xUnit, NUnit and MSTest tests in the Testing view. (Open VSX)
- Nifty C# Scratchpad: Run C# Snippets & NuGet: Run C# snippets instantly with NuGet packages and rich Dump() output, a LINQPad-style scratchpad and Polyglot Notebooks replacement. (Open VSX)
- Nifty NuGet: NuGet Package Manager: Search, add, update and remove NuGet packages, see outdated and vulnerable ones, in VS Code, Cursor and every editor. (Open VSX)
- Nifty .NET Pack: 5 Nifty extensions for C# and .NET development: .NET Explorer, NuGet, C# Templates, XAML, C# Scratchpad. (Open VSX)
- Nifty Paste JSON as Code: JSON to Types: Turn JSON on your clipboard into types for TypeScript, C#, Go, Rust, Python, Java, Kotlin, Swift, Dart and more. (Open VSX)
- Nifty Tools for Unity: .meta Files & GUIDs: Unity helpers for any editor: .meta files follow renamed and moved assets, GUIDs resolve to assets, find where an asset is used, hide .meta files, and MonoBehaviour message completion. (Open VSX)
See all 100+ Nifty extensions and web tools at https://getnifty.dev
| |