Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Namespace StarterNew to Visual Studio Code? Get it now.
Namespace Starter

Namespace Starter

Bob0911

|
183 installs
| (0) | Free
auto write namespace when create new .cs file
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Features

Auto write namespace when create new .cs file.

Auto write Namespace

Custom Template

The default template only write namespace, but you can add other things you want by configuration.

Configuration Settings

This extension use Mustache to render result. the placeholder {{namespace}} and {{filename}} will be replaced by extension.

//.vscode/settings.json
{
  "namespaceStarter.templates": [
    {
      "name": "interface",
      "pattern": "**/I[A-Z]*.cs",
      "content": "namespace {{namespace}};\npublic interface {{filename}}\n{\n}" //
    },
    {
      "name": "controller",
      "pattern": "**/*Controller.cs",
      "content": "using Microsoft.AspNetCore.Mvc;\nnamespace {{namespace}};\n[ApiController]\n[Route(\"[controller]\")]\npublic class {{filename}} : ControllerBase\n{\n}"
    }
  ]
}

Write interface Write controller

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft