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
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