Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / November 2005

Tip: Looking for answers? Try searching our database.

Where is Default Namespace located?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gery D. Dorazio - 12 Nov 2005 18:34 GMT
After installing VS 2005 and creating a new web project I was surprised to
see that it does not set a default namespace. In fact there is no namespace
setting at all. The project is a new web site using the file system to an
existing IIS windows server. After the project is created and I right click
the project and look at the property pages for the project there is no
'Common Properties' or 'Configuration Properties' like VS 2003. It only has
'References', 'Build', 'Accessibility', 'Start Options', and 'MSBuild
Options'. None of these have anywhere to set default namespace. This is
Visual Studio 2005 Standard Edition.

Thanks,
Gery

Gery D. Dorazio
Development Engineer
EnQue Corp. phone:
704.377.3327
email : gdorazio@enque.net
web : www.EnQue.net 
clintonG - 12 Nov 2005 21:02 GMT
Its been this way since the 1st 2.0 beta as I recall. I'm still a bit
confused myself though as I started a project and built quite a few pages
and then thought "uh-oh" I better start implementing namespaces but all of
my attempts to do so raised errors I don't understand yet. So... not knowing
any better I would start naming ASAP and see what happens noting most of
this is now up to the same developer the wierdos at Microsoft say they want
to make things easier for %-)

<%= Clinton Gallagher
        METROmilwaukee (sm) "A Regional Information Service"
        NET csgallagher AT metromilwaukee.com
        URL http://metromilwaukee.com/
        URL http://clintongallagher.metromilwaukee.com/

> After installing VS 2005 and creating a new web project I was surprised to
> see that it does not set a default namespace. In fact there is no
[quoted text clipped - 15 lines]
> email : gdorazio@enque.net
> web : www.EnQue.net
Gery D. Dorazio - 13 Nov 2005 02:19 GMT
Right now this is a real pain in the you know what. I have been looking at
several 'conversion' articles on MSDN and none of them explain what is going
on with namespace removal. I guess they expect us to know this by osmosis.
If anyone at Microsoft it would be really helpful if you could answer these
requests:

1) Where is documentation that explains the change from default namespaces
in Visual Studio 2003/2003 to none in Visual Studio 2005? (evidenced by the
obvious changes to the project property pages)
2) How should a developer consider changing or removing namespaces when
taken in the context of the now automatic multiple assemblies that are
generated in a web project?
3) How does putting classes into a namespace within files located in the
App_Code directory affect the ability of the aspx pages to actually find the
classes? Is this automatic in which case we should really know how this
works, or are we supposed to do something specific like prefix the class
names with the namespace?

Maybe this is probably hidden somewhere deep in the mines of the MSDN or
.NET framework docs but I haven't been able to hit the vein yet. Any
suggestions appreciated.

Thanks,
Gery

Gery D. Dorazio
Development Engineer
EnQue Corp.
phone: 704.377.3327
email : gdorazio@enque.net
web : www.EnQue.net

> Its been this way since the 1st 2.0 beta as I recall. I'm still a bit
> confused myself though as I started a project and built quite a few pages
[quoted text clipped - 29 lines]
>> email : gdorazio@enque.net
>> web : www.EnQue.net
Mikhail Arkhipov (Microsoft) - 13 Nov 2005 03:32 GMT
On 11/12/05 18:19, in article u22Z1i$5FHA.3416@TK2MSFTNGP15.phx.gbl, "Gery
D. Dorazio" <gdorazio@enque.net> wrote:

> Right now this is a real pain in the you know what. I have been looking at
> several 'conversion' articles on MSDN and none of them explain what is going
[quoted text clipped - 62 lines]
>>> email : gdorazio@enque.net
>>> web : www.EnQue.net

VS 2005 compilation model matches ASP.NET runtime server-side compilation
model. With the introduction  of partial classes it became unnecessary to
require developers to define namespaces since VS 2005 only shows you part of
the class, the rest od the code is dynamically generated. I'd like to learn
more about why you need to declare a specific namespace for pages. You can
still declare class name and you can declare namespace for custom controls.

If files in App_Code use certain namespace, you may have to add

<%@ Import Namespace="your-namespace-here" %>

to your pages.

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights
Gery D. Dorazio - 13 Nov 2005 09:16 GMT
Hi Mikhail,

Basically VS 2002/2003 taught us to use namespaces. This made sense
especially when building a web site with say multiple Default.aspx pages in
different folders such as admin, account, products...essentially an
organizational management tool. In a products folder the customer uses
CustomerCart.aspx to see their items but in the Admin folder I am looking at
the customer cart and it has quit a bit of different functions that the
customer is not privy to...same class, different folder, hence use a
namespace. VS 2002/2003 had it all set up with the DefaultNamespace property
and pages generated in different folders automatically generated namespaces
for those folders. This is also true with controls defined in different
parts of the sites I develop.

Since VS 2005 now has no namespace there is no automatic management help for
this type of class segregation which is the whole idea of namespaces in the
first place....except for the convoluted class names that are now generated.
Appears as though the automatic dynamic generation of the auto portion of
the partial classes was traded for the convoluted naming. Not what I as a
developer am expecting and it is not something I want either. When the
wizard asks me for a new web form name I expect the class name to match. Now
it does not.

It would really be helpful if I could get the three questions answered that
I already posed. That is because at this point doing a conversion from VS
2002/2003 is not obvious nor easy.

Thanks,
Gery

Gery D. Dorazio
Development Engineer
EnQue Corp.
phone: 704.377.3327
email : gdorazio@enque.net
web : www.EnQue.net

> On 11/12/05 18:19, in article u22Z1i$5FHA.3416@TK2MSFTNGP15.phx.gbl, "Gery
> D. Dorazio" <gdorazio@enque.net> wrote:
[quoted text clipped - 96 lines]
> Mikhail Arkhipov (Microsoft)
> -- This post is provided 'AS IS' with no warranties and confers no rights
Mikhail Arkhipov (Microsoft) - 13 Nov 2005 17:28 GMT
On 11/13/05 1:16, in article OW1SoLD6FHA.2092@TK2MSFTNGP12.phx.gbl, "Gery D.
Dorazio" <gdorazio@enque.net> wrote:

>> Thanks
>> Mikhail Arkhipov (Microsoft)
>> -- This post is provided 'AS IS' with no warranties and confers no rights

You'll have much better chance getting the answer in forums at www.asp.net
where ASP.NET team members are answering to customers.

Thanks
Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.