Just say no to Namespace Providers

4. February 2009

I'm lazy and Visual Studio is big, huge even. These two facts combined cause me to ignore 80% of the features Visual Studio offers me, I'm just too lazy to look for them. Most of the time I just use VS as a glorified text-editor. Some people would tell me that this is a good thing, usually these are the people who tried TDD with MSTest. And to be honest things have gotten better since I use Resharper, it's far more discoverable than Visual Studio is. But sometimes I still find hidden features that solve things that have irritated me for a long time.

Usually projects, folders and namespaces follow the same structure, classes in that folder should be in a namespace of the same name. But sometimes folders are just folders, so you don't want Visual Studio using their name in the namespace when creating new classes.

namespaceproviderLazy as I am I just ignored all this. It still irritated me, but not enough to get me to do anything about it. But today I found there is actually an easy solution; "Namespace Providers"! Of course! Why didn't I think of this before.

Long story short; Folders are namespace providers by default. That is, they provide extensions to the namespace of things you put in them. But this is actually something you can turn off when you look at the properties of a folder.

Now you're all going to tell me that you already knew this feature and that I'm wasting your time telling you about it, and that I should stop posting crap like this. And you're right but I hope I can save someone some time, someone who is as lazy as I am. To cater to this group of people I even added a screenshot to show where to find the illusive "Namespace Provider" option.

Comments are closed

Powered by BlogEngine.NET 1.5.0.7
Theme adapted from BlogEngine.NET standard theme by Mads Kristensen

Mendelt Siebenga

Mendelt Siebenga with coffeeMendelt Siebenga works as a C# programmer. In his spare time he's been known to pick up Python, Lisp and even a soldering iron from time to time.

You can also find me here