No Namespace Specified - Where Do the Types Live?

  • Thread starter Thread starter Johnson
  • Start date Start date
J

Johnson

I just converted an ASP.NET Web Site to be an ASP.NET Web Application
project type in Visual Studio 2005. After the conversion, the whole thing
still works - it builds and the Web app runs just fine. However, none of the
classes are placed explicitly in any namespace. The ASP.NET Web Site project
type apparentlyl infers namespace from the site's directory structure. But
Visual Studio's conversion process ("Convert to Web Application") does not
explicitly add any namespaces to any of the classes.

So, where do the classes live after the conversion? Is there some "default"
or "global" namespace into which the classes are placed? Just curious... I'm
not trying to solve any specific runtime problem here.

Thanks.
 
re:
!> So, where do the classes live after the conversion?

In the VS 2005 or 2008 IDEs, right-click your Project's name in the Solution Explorer,
select "Properties", then click on the Application menu on the left.

In 2008, you'll see a textbox for the "default namespace";
in 2005, the textbox is named "root namespace".

Set them to whatever you'd like the default/root namespace to be.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
I just converted an ASP.NET Web Site to be an ASP.NET Web Application
project type in Visual Studio 2005. After the conversion, the whole thing
still works - it builds and the Web app runs just fine. However, none of the
classes are placed explicitly in any namespace. The ASP.NET Web Site project
type apparentlyl infers namespace from the site's directory structure. But
Visual Studio's conversion process ("Convert to Web Application") does not
explicitly add any namespaces to any of the classes.

So, where do the classes live after the conversion? Is there some "default"
or "global" namespace into which the classes are placed? Just curious... I'm
not trying to solve any specific runtime problem here.

Thanks.

Hi,

They will live inside teh namespace defined by your project.
Do this test, add a new webform and see where it place it, most
probably you will see the class beind declared inside the namespace as
you expected
 
re:
!> So, where do the classes live after the conversion?

In the VS 2005 or 2008 IDEs, right-click your Project's name in the Solution Explorer,
select "Properties", then click on the Application menu on the left.

In 2008, you'll see a textbox for the "default namespace";
in 2005, the textbox is named "root namespace".

Set them to whatever you'd like the default/root namespace to be.

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
======================================

Hi Juan,

Nice seeing you around, been a while since we last talked to each
other.
Hope everything is ok with you.


cheers,
Ignacio.
 
Back
Top