C# – Setting Default Namespace in Visual Web Developer 2008 Express

asp.netcvisual-studio-2008visual-web-developer

Hi all I've just started a new project using Visual Web Developer 2008 Express and all my code behinds are not in any namespace. How can I set the default namespace for the project?

In VisualStudioPro it used to be in project properties, the website properties in Visual Web Developer 2008 Express seem very … express.

Thanks,

David.

Best Answer

Visual Web Developer (prior to 2008 SP1) does not support Web Application projects. Default namespace is only available in Web Application projects.

If you really want to add your classes to a namespace, you should do it manually (the namespace surround with code snippet can prove pretty useful) by enclosing them in a namespace statement:

namespace MyDefaultNamespace {
   // original code
}