Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Exclude From Namespace
Exclude From Namespace

Exclude From Namespace

sonesoul

|
2 installs
| (0) | Free
Automatically removes excluded directory names from C# namespaces.
Download

Exclude From Namespace

Prevent Visual Studio from automatically including specific folders in generated C# namespaces.

Features

  • Automatically fixes namespaces when new C# files are added
  • Configurable excluded directory name
  • Enable/disable support through settings
  • Lightweight and focused
  • Works with Visual Studio's native extension system

Why?

By default, Visual Studio includes folder names when generating namespaces.
Creating a file at MyProject/src/Utils/ results in:

namespace MyProject.src.Utils
{
  internal class MyClass { }
}

However, folders like src or Source usually should not be part of the namespace. Exclude From Namespace automatically removes configured directory names from generated namespaces.

Before:

namespace MyProject.src.Utils

After:

namespace MyProject.Utils

Fully automatic. All you need is to choose the folder to exclude.

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