Disadvantages in Visual Studio 2005 (Web sites)

Discussion in 'ASP .Net' started by m.roello@dev.it, Jan 26, 2006.

  1. Guest

    In the book:
    "Working with Microsoft Visual Studio 2005"
    Craig Skibo wrote:
    "The power of Visual Studio 2005 lies in its ability to empower users to
    build, test, and debug powerful applications quickly and easly."

    I don't agree on what concernes ASP .NET Web Sites in VS2005.

    All what involves Namespaces in Web sites has been disappeared. I know
    you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    project I can subdivide the App_Code Folder in subfolders, but if I use
    the Powerfull "Class View" Window, I'm not very glad to see an infinity
    number of classes, all placed at the root of the project namespace.

    Grouping in namespaces is one of the most powerful skills tha .net gave
    us, since 1.0 and not only for .Net Windows Projects.

    Someone could reply me that the problem is pre-compilation. I know that
    now you can choose how to build your Web site, and this is very good.
    But the need of defining namespaces and grouping classes is indipendent
    from the way I'll decide to deploy the Web Site.

    Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    black hole.

    I'm sorry for this lines, but I'm tired to search for workarounds for an
    IDE, abive all when a functionality was already present in the previous
    version.

    Marco Roello
     
    , Jan 26, 2006
    #1
    1. Advertising

  2. Dear Disadvantaged,

    I don't often use the new class viewer, it is overpowering like you said.

    I'm am however using namespace inside the app_code folder.
    My Namespaces do come up in the IDE as expected type assist, imports, etc.






    "" wrote:

    > In the book:
    > "Working with Microsoft Visual Studio 2005"
    > Craig Skibo wrote:
    > "The power of Visual Studio 2005 lies in its ability to empower users to
    > build, test, and debug powerful applications quickly and easly."
    >
    > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    >
    > All what involves Namespaces in Web sites has been disappeared. I know
    > you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    > project I can subdivide the App_Code Folder in subfolders, but if I use
    > the Powerfull "Class View" Window, I'm not very glad to see an infinity
    > number of classes, all placed at the root of the project namespace.
    >
    > Grouping in namespaces is one of the most powerful skills tha .net gave
    > us, since 1.0 and not only for .Net Windows Projects.
    >
    > Someone could reply me that the problem is pre-compilation. I know that
    > now you can choose how to build your Web site, and this is very good.
    > But the need of defining namespaces and grouping classes is indipendent
    > from the way I'll decide to deploy the Web Site.
    >
    > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    > black hole.
    >
    > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > IDE, abive all when a functionality was already present in the previous
    > version.
    >
    > Marco Roello
    >
    >
     
    =?Utf-8?B?RFdT?=, Jan 26, 2006
    #2
    1. Advertising

  3. Patrice Guest

    Not familier with VS.NET 2005 but can't you speciify the namespaces in your
    classes with the appropriate statement ?

    --
    Patrice

    <> a écrit dans le message de
    news:...
    > In the book:
    > "Working with Microsoft Visual Studio 2005"
    > Craig Skibo wrote:
    > "The power of Visual Studio 2005 lies in its ability to empower users to
    > build, test, and debug powerful applications quickly and easly."
    >
    > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    >
    > All what involves Namespaces in Web sites has been disappeared. I know
    > you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    > project I can subdivide the App_Code Folder in subfolders, but if I use
    > the Powerfull "Class View" Window, I'm not very glad to see an infinity
    > number of classes, all placed at the root of the project namespace.
    >
    > Grouping in namespaces is one of the most powerful skills tha .net gave
    > us, since 1.0 and not only for .Net Windows Projects.
    >
    > Someone could reply me that the problem is pre-compilation. I know that
    > now you can choose how to build your Web site, and this is very good.
    > But the need of defining namespaces and grouping classes is indipendent
    > from the way I'll decide to deploy the Web Site.
    >
    > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    > black hole.
    >
    > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > IDE, abive all when a functionality was already present in the previous
    > version.
    >
    > Marco Roello
    >
     
    Patrice, Jan 26, 2006
    #3
  4. Thanks for your opinion,

    Maybe I've not explained very well the problem.
    I've already written that I know that I can MANUALLY define namespace, but
    the RAD tool doesn't help me in any mode....

    These are the real questions:

    In the App_Code directory, you can define custom namespaces for .cs files.
    But if you add a Dataset (.xsd) how can you define his namespace in visual
    studio?

    A Web site isn't a collection of classes?

    Why a Windows Form Project or a ClassLibrary project manage namespaces in
    the right mode?

    Why in Visual Studio .Net 2003 I could do it and now not?

    Anyone know what does it mean to open hundred of aspx files and write the
    namespace?

    Thanks

    "DWS" wrote:

    > Dear Disadvantaged,
    >
    > I don't often use the new class viewer, it is overpowering like you said.
    >
    > I'm am however using namespace inside the app_code folder.
    > My Namespaces do come up in the IDE as expected type assist, imports, etc.
    >
    >
    >
    >
    >
    >
    > "" wrote:
    >
    > > In the book:
    > > "Working with Microsoft Visual Studio 2005"
    > > Craig Skibo wrote:
    > > "The power of Visual Studio 2005 lies in its ability to empower users to
    > > build, test, and debug powerful applications quickly and easly."
    > >
    > > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    > >
    > > All what involves Namespaces in Web sites has been disappeared. I know
    > > you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    > > project I can subdivide the App_Code Folder in subfolders, but if I use
    > > the Powerfull "Class View" Window, I'm not very glad to see an infinity
    > > number of classes, all placed at the root of the project namespace.
    > >
    > > Grouping in namespaces is one of the most powerful skills tha .net gave
    > > us, since 1.0 and not only for .Net Windows Projects.
    > >
    > > Someone could reply me that the problem is pre-compilation. I know that
    > > now you can choose how to build your Web site, and this is very good.
    > > But the need of defining namespaces and grouping classes is indipendent
    > > from the way I'll decide to deploy the Web Site.
    > >
    > > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    > > black hole.
    > >
    > > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > > IDE, abive all when a functionality was already present in the previous
    > > version.
    > >
    > > Marco Roello
    > >
    > >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 26, 2006
    #4
  5. Thanks Patrice,

    sorry but I'm talking about DISADVANTAGES of Visual Studio, not of the .Net
    framework.

    "Patrice" wrote:

    > Not familier with VS.NET 2005 but can't you speciify the namespaces in your
    > classes with the appropriate statement ?
    >
    > --
    > Patrice
    >
    > <> a écrit dans le message de
    > news:...
    > > In the book:
    > > "Working with Microsoft Visual Studio 2005"
    > > Craig Skibo wrote:
    > > "The power of Visual Studio 2005 lies in its ability to empower users to
    > > build, test, and debug powerful applications quickly and easly."
    > >
    > > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    > >
    > > All what involves Namespaces in Web sites has been disappeared. I know
    > > you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    > > project I can subdivide the App_Code Folder in subfolders, but if I use
    > > the Powerfull "Class View" Window, I'm not very glad to see an infinity
    > > number of classes, all placed at the root of the project namespace.
    > >
    > > Grouping in namespaces is one of the most powerful skills tha .net gave
    > > us, since 1.0 and not only for .Net Windows Projects.
    > >
    > > Someone could reply me that the problem is pre-compilation. I know that
    > > now you can choose how to build your Web site, and this is very good.
    > > But the need of defining namespaces and grouping classes is indipendent
    > > from the way I'll decide to deploy the Web Site.
    > >
    > > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    > > black hole.
    > >
    > > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > > IDE, abive all when a functionality was already present in the previous
    > > version.
    > >
    > > Marco Roello
    > >

    >
    >
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 26, 2006
    #5
  6. Scott Allen Guest

    On Thu, 26 Jan 2006 17:26:54 +0100, wrote:

    >
    >Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    >black hole.
    >


    I don't think it's a big issue. 99% of the types in code-behind /
    code-beside files are never used outside of the files they are defined
    in. Many times they end up in isolated assemblies.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/
     
    Scott Allen, Jan 26, 2006
    #6
  7. In actuality, if you are developing everything within the same website, then
    why do you need a namespace. If you use the App_Code directory for your
    website-specific classes and you have multiple ASPX pages (with or without
    code-behind), they are all compiled into the same assembly, so where's the
    need for a namespace.

    Note that I add my namespaces to my website files and I have no problem with
    it. It's not a major issue.
    --
    Christopher A. Reed
    "The oxen are slow, but the earth is patient."

    <> wrote in message
    news:...
    > In the book:
    > "Working with Microsoft Visual Studio 2005"
    > Craig Skibo wrote:
    > "The power of Visual Studio 2005 lies in its ability to empower users to
    > build, test, and debug powerful applications quickly and easly."
    >
    > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    >
    > All what involves Namespaces in Web sites has been disappeared. I know you
    > can still MANUALLY manage them, but not QUICKLY and EASLY. In a project I
    > can subdivide the App_Code Folder in subfolders, but if I use the
    > Powerfull "Class View" Window, I'm not very glad to see an infinity number
    > of classes, all placed at the root of the project namespace.
    >
    > Grouping in namespaces is one of the most powerful skills tha .net gave
    > us, since 1.0 and not only for .Net Windows Projects.
    >
    > Someone could reply me that the problem is pre-compilation. I know that
    > now you can choose how to build your Web site, and this is very good. But
    > the need of defining namespaces and grouping classes is indipendent from
    > the way I'll decide to deploy the Web Site.
    >
    > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG black
    > hole.
    >
    > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > IDE, abive all when a functionality was already present in the previous
    > version.
    >
    > Marco Roello
    >
     
    Christopher Reed, Jan 27, 2006
    #7
  8. I'm sorry but I don't agree with you.

    All the .Net framework is a library subdivided in namespaces.

    I'm sorry if you say that you don't need namespaces, you say that .Net
    framework doesn't need them.



    "Christopher Reed" wrote:

    > In actuality, if you are developing everything within the same website, then
    > why do you need a namespace. If you use the App_Code directory for your
    > website-specific classes and you have multiple ASPX pages (with or without
    > code-behind), they are all compiled into the same assembly, so where's the
    > need for a namespace.
    >
    > Note that I add my namespaces to my website files and I have no problem with
    > it. It's not a major issue.
    > --
    > Christopher A. Reed
    > "The oxen are slow, but the earth is patient."
    >
    > <> wrote in message
    > news:...
    > > In the book:
    > > "Working with Microsoft Visual Studio 2005"
    > > Craig Skibo wrote:
    > > "The power of Visual Studio 2005 lies in its ability to empower users to
    > > build, test, and debug powerful applications quickly and easly."
    > >
    > > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    > >
    > > All what involves Namespaces in Web sites has been disappeared. I know you
    > > can still MANUALLY manage them, but not QUICKLY and EASLY. In a project I
    > > can subdivide the App_Code Folder in subfolders, but if I use the
    > > Powerfull "Class View" Window, I'm not very glad to see an infinity number
    > > of classes, all placed at the root of the project namespace.
    > >
    > > Grouping in namespaces is one of the most powerful skills tha .net gave
    > > us, since 1.0 and not only for .Net Windows Projects.
    > >
    > > Someone could reply me that the problem is pre-compilation. I know that
    > > now you can choose how to build your Web site, and this is very good. But
    > > the need of defining namespaces and grouping classes is indipendent from
    > > the way I'll decide to deploy the Web Site.
    > >
    > > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG black
    > > hole.
    > >
    > > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > > IDE, abive all when a functionality was already present in the previous
    > > version.
    > >
    > > Marco Roello
    > >

    >
    >
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 27, 2006
    #8
  9. You are confusing the problem.

    Namespaces aren't assemblies.

    You can define the same namespace for different assemblies.

    NAMESPACES are LOGICAL rappresentation of your class library.

    And a Web site is an Application with one or more assemblies.

    Why the assemblies of a web site cannot be rappresented in namespaces?

    "Scott Allen" wrote:

    > On Thu, 26 Jan 2006 17:26:54 +0100, wrote:
    >
    > >
    > >Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    > >black hole.
    > >

    >
    > I don't think it's a big issue. 99% of the types in code-behind /
    > code-beside files are never used outside of the files they are defined
    > in. Many times they end up in isolated assemblies.
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 27, 2006
    #9
  10. A question to everyone tells me that they don't need namespaces:

    In your web site. You have 2 folders with 2 default.aspx files, one in each
    folder.

    If build the web site, you'll get an error, because the compiler finds two
    classes with the same name.

    The solution is to define a different namespace for each aspx file (or one
    of them).

    Now, if I have to define ONE namespace for ONE class, a good developer
    SHOULD define namespaces for ALL the classes in the projects.

    I'll post the question in another thread.

    "" wrote:

    > In the book:
    > "Working with Microsoft Visual Studio 2005"
    > Craig Skibo wrote:
    > "The power of Visual Studio 2005 lies in its ability to empower users to
    > build, test, and debug powerful applications quickly and easly."
    >
    > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    >
    > All what involves Namespaces in Web sites has been disappeared. I know
    > you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    > project I can subdivide the App_Code Folder in subfolders, but if I use
    > the Powerfull "Class View" Window, I'm not very glad to see an infinity
    > number of classes, all placed at the root of the project namespace.
    >
    > Grouping in namespaces is one of the most powerful skills tha .net gave
    > us, since 1.0 and not only for .Net Windows Projects.
    >
    > Someone could reply me that the problem is pre-compilation. I know that
    > now you can choose how to build your Web site, and this is very good.
    > But the need of defining namespaces and grouping classes is indipendent
    > from the way I'll decide to deploy the Web Site.
    >
    > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    > black hole.
    >
    > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > IDE, abive all when a functionality was already present in the previous
    > version.
    >
    > Marco Roello
    >
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 27, 2006
    #10
  11. answer me this question please:

    In the App_Code directory, you can define custom namespaces for .cs files.
    But if you add a Dataset (.xsd) how can you define his namespace in the web
    project?


    "Christopher Reed" wrote:

    > In actuality, if you are developing everything within the same website, then
    > why do you need a namespace. If you use the App_Code directory for your
    > website-specific classes and you have multiple ASPX pages (with or without
    > code-behind), they are all compiled into the same assembly, so where's the
    > need for a namespace.
    >
    > Note that I add my namespaces to my website files and I have no problem with
    > it. It's not a major issue.
    > --
    > Christopher A. Reed
    > "The oxen are slow, but the earth is patient."
    >
    > <> wrote in message
    > news:...
    > > In the book:
    > > "Working with Microsoft Visual Studio 2005"
    > > Craig Skibo wrote:
    > > "The power of Visual Studio 2005 lies in its ability to empower users to
    > > build, test, and debug powerful applications quickly and easly."
    > >
    > > I don't agree on what concernes ASP .NET Web Sites in VS2005.
    > >
    > > All what involves Namespaces in Web sites has been disappeared. I know you
    > > can still MANUALLY manage them, but not QUICKLY and EASLY. In a project I
    > > can subdivide the App_Code Folder in subfolders, but if I use the
    > > Powerfull "Class View" Window, I'm not very glad to see an infinity number
    > > of classes, all placed at the root of the project namespace.
    > >
    > > Grouping in namespaces is one of the most powerful skills tha .net gave
    > > us, since 1.0 and not only for .Net Windows Projects.
    > >
    > > Someone could reply me that the problem is pre-compilation. I know that
    > > now you can choose how to build your Web site, and this is very good. But
    > > the need of defining namespaces and grouping classes is indipendent from
    > > the way I'll decide to deploy the Web Site.
    > >
    > > Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG black
    > > hole.
    > >
    > > I'm sorry for this lines, but I'm tired to search for workarounds for an
    > > IDE, abive all when a functionality was already present in the previous
    > > version.
    > >
    > > Marco Roello
    > >

    >
    >
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 27, 2006
    #11
  12. Scott Allen Guest

    On Fri, 27 Jan 2006 00:43:02 -0800, abunet <> wrote:

    >You are confusing the problem.
    >
    >Namespaces aren't assemblies.
    >


    I never said they were.

    >You can define the same namespace for different assemblies.
    >
    >
    >NAMESPACES are LOGICAL rappresentation of your class library.
    >
    >And a Web site is an Application with one or more assemblies.
    >
    >Why the assemblies of a web site cannot be rappresented in namespaces?
    >


    You aren't writing a class library, you are writing a web application.

    The ASP.NET runtime will be the only client for all those Page and
    UserControl derived types in your web application. The runtime doesn't
    need namespaces to figure out what type to use. This is unlike a
    developer. Namespaces present logical groupings for developers. I
    don't see how there is a BIG black hole when we don't have to write
    code like:

    using My.WebForms;

    Default_aspx form = new Default_aspx();

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    >"Scott Allen" wrote:
    >
    >> On Thu, 26 Jan 2006 17:26:54 +0100, wrote:
    >>
    >> >
    >> >Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    >> >black hole.
    >> >

    >>
    >> I don't think it's a big issue. 99% of the types in code-behind /
    >> code-beside files are never used outside of the files they are defined
    >> in. Many times they end up in isolated assemblies.
    >>
    >> --
    >> Scott
    >> http://www.OdeToCode.com/blogs/scott/
    >>
     
    Scott Allen, Jan 27, 2006
    #12
  13. Scott Allen Guest

    On Fri, 27 Jan 2006 00:38:02 -0800, abunet <> wrote:

    >I'm sorry but I don't agree with you.
    >
    >All the .Net framework is a library subdivided in namespaces.
    >
    >I'm sorry if you say that you don't need namespaces, you say that .Net
    >framework doesn't need them.
    >
    >


    The framework does need namespaces. It would be a nightmare to find
    classes in a flat hierarchy.

    The difference is that the types in the framework have to be found by
    human developers. The types in a web application are used only by the
    runtime.

    There are exceptions of course, like the PreviousPage property for a
    cross page postback, but even then I think it's preferable to
    represent the other entity using an interface or a base class defined
    in a class library (or App_Code) that IS inside a logical namespace
    (so it can be found).

    Leave the Page and UserControl derived types as islands unto
    themselves.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/
     
    Scott Allen, Jan 27, 2006
    #13
  14. Scott Allen Guest

    Could you give us the exact error? Perhaps some code? It sounds like
    something else is wrong.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Fri, 27 Jan 2006 00:51:02 -0800, abunet <> wrote:

    >A question to everyone tells me that they don't need namespaces:
    >
    >In your web site. You have 2 folders with 2 default.aspx files, one in each
    >folder.
    >
    >If build the web site, you'll get an error, because the compiler finds two
    >classes with the same name.
    >
    >The solution is to define a different namespace for each aspx file (or one
    >of them).
    >
    >Now, if I have to define ONE namespace for ONE class, a good developer
    >SHOULD define namespaces for ALL the classes in the projects.
    >
    >I'll post the question in another thread.
    >
    >"" wrote:
    >
    >> In the book:
    >> "Working with Microsoft Visual Studio 2005"
    >> Craig Skibo wrote:
    >> "The power of Visual Studio 2005 lies in its ability to empower users to
    >> build, test, and debug powerful applications quickly and easly."
    >>
    >> I don't agree on what concernes ASP .NET Web Sites in VS2005.
    >>
    >> All what involves Namespaces in Web sites has been disappeared. I know
    >> you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    >> project I can subdivide the App_Code Folder in subfolders, but if I use
    >> the Powerfull "Class View" Window, I'm not very glad to see an infinity
    >> number of classes, all placed at the root of the project namespace.
    >>
    >> Grouping in namespaces is one of the most powerful skills tha .net gave
    >> us, since 1.0 and not only for .Net Windows Projects.
    >>
    >> Someone could reply me that the problem is pre-compilation. I know that
    >> now you can choose how to build your Web site, and this is very good.
    >> But the need of defining namespaces and grouping classes is indipendent
    >> from the way I'll decide to deploy the Web Site.
    >>
    >> Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    >> black hole.
    >>
    >> I'm sorry for this lines, but I'm tired to search for workarounds for an
    >> IDE, abive all when a functionality was already present in the previous
    >> version.
    >>
    >> Marco Roello
    >>
    >>
     
    Scott Allen, Jan 27, 2006
    #14
  15. Maybe I'm not explaining very well.

    - First of all, if you make a little search on the newsgroup or the web
    (keywords: dataset namespace) , you'll find a lot of post with the same
    problem.

    - Second, You are forgotting that in VS2003, the IDE works in this manner:
    if you add a folder to a Web Project, and then an aspx file into it, if you
    take a look at the code behind, you will see that the class will have a
    namespace with this construct:

    namespace myprojectnamespace.myfolder

    - To reproduce the problem in VS2005, just add 2 folders to a web site, and
    then 2 web forms, each aspx in one folder, and name them default.apsx. You'll
    get an error.

    - Third do the same with 2 xsd files. In a web site add two folders in the
    App_Code. Call each xsd file DataSet1.xsd and put each xsd in a folder.

    When you say that you don't need namespaces, I get suprised.
    You should only answer this questions:

    1) How can you define the namespace of a xsd file in a Web site?
    2) Custom Namespaces are built automatically in ClassLibrary and
    WindowsForms projects. Why not in Web sites?
    3) Why in VS2003 the project namespaces were created automatically and now
    not? (compatibility)

    Thanks

    "Scott Allen" wrote:

    > Could you give us the exact error? Perhaps some code? It sounds like
    > something else is wrong.
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Fri, 27 Jan 2006 00:51:02 -0800, abunet <> wrote:
    >
    > >A question to everyone tells me that they don't need namespaces:
    > >
    > >In your web site. You have 2 folders with 2 default.aspx files, one in each
    > >folder.
    > >
    > >If build the web site, you'll get an error, because the compiler finds two
    > >classes with the same name.
    > >
    > >The solution is to define a different namespace for each aspx file (or one
    > >of them).
    > >
    > >Now, if I have to define ONE namespace for ONE class, a good developer
    > >SHOULD define namespaces for ALL the classes in the projects.
    > >
    > >I'll post the question in another thread.
    > >
    > >"" wrote:
    > >
    > >> In the book:
    > >> "Working with Microsoft Visual Studio 2005"
    > >> Craig Skibo wrote:
    > >> "The power of Visual Studio 2005 lies in its ability to empower users to
    > >> build, test, and debug powerful applications quickly and easly."
    > >>
    > >> I don't agree on what concernes ASP .NET Web Sites in VS2005.
    > >>
    > >> All what involves Namespaces in Web sites has been disappeared. I know
    > >> you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
    > >> project I can subdivide the App_Code Folder in subfolders, but if I use
    > >> the Powerfull "Class View" Window, I'm not very glad to see an infinity
    > >> number of classes, all placed at the root of the project namespace.
    > >>
    > >> Grouping in namespaces is one of the most powerful skills tha .net gave
    > >> us, since 1.0 and not only for .Net Windows Projects.
    > >>
    > >> Someone could reply me that the problem is pre-compilation. I know that
    > >> now you can choose how to build your Web site, and this is very good.
    > >> But the need of defining namespaces and grouping classes is indipendent
    > >> from the way I'll decide to deploy the Web Site.
    > >>
    > >> Is this a "by design" issue?. Or it is a bug? In my opinion is a BIG
    > >> black hole.
    > >>
    > >> I'm sorry for this lines, but I'm tired to search for workarounds for an
    > >> IDE, abive all when a functionality was already present in the previous
    > >> version.
    > >>
    > >> Marco Roello
    > >>
    > >>

    >
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 28, 2006
    #15
  16. Mark Rae Guest

    "abunet" <> wrote in message
    news:...

    >A question to everyone tells me that they don't need namespaces:
    >
    > In your web site. You have 2 folders with 2 default.aspx files, one in
    > each
    > folder.
    >
    > If build the web site, you'll get an error, because the compiler finds two
    > classes with the same name.
    >
    > The solution is to define a different namespace for each aspx file (or one
    > of them).


    That simply isn't true.

    <webroot>
    /home
    default.aspx
    <%@ Page language="c#" CodeFile="default.aspx.cs"
    Inherits="home_default" %>
    default.aspx.cs
    public partial class home_default
    /welcome
    default.aspx
    <%@ Page language="c#" CodeFile="default.aspx.cs"
    Inherits="welcome_default" %>
    default.aspx.cs
    public partial class welcome_default

    > Now, if I have to define ONE namespace for ONE class, a good developer
    > SHOULD define namespaces for ALL the classes in the projects.


    Why? Says who?
     
    Mark Rae, Jan 28, 2006
    #16
  17. Mark,
    we are talking about Visual Studio 2005. The RAD Tool.
    I know that you can manually define different namespaces.

    Please read again all the posts.

    "Mark Rae" wrote:

    > "abunet" <> wrote in message
    > news:...
    >
    > >A question to everyone tells me that they don't need namespaces:
    > >
    > > In your web site. You have 2 folders with 2 default.aspx files, one in
    > > each
    > > folder.
    > >
    > > If build the web site, you'll get an error, because the compiler finds two
    > > classes with the same name.
    > >
    > > The solution is to define a different namespace for each aspx file (or one
    > > of them).

    >
    > That simply isn't true.
    >
    > <webroot>
    > /home
    > default.aspx
    > <%@ Page language="c#" CodeFile="default.aspx.cs"
    > Inherits="home_default" %>
    > default.aspx.cs
    > public partial class home_default
    > /welcome
    > default.aspx
    > <%@ Page language="c#" CodeFile="default.aspx.cs"
    > Inherits="welcome_default" %>
    > default.aspx.cs
    > public partial class welcome_default
    >
    > > Now, if I have to define ONE namespace for ONE class, a good developer
    > > SHOULD define namespaces for ALL the classes in the projects.

    >
    > Why? Says who?
    >
    >
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 28, 2006
    #17
  18. Scott Allen Guest

    On Sat, 28 Jan 2006 00:59:26 -0800, abunet <> wrote:

    >
    >- To reproduce the problem in VS2005, just add 2 folders to a web site, and
    >then 2 web forms, each aspx in one folder, and name them default.apsx. You'll
    >get an error.
    >


    Can you tell us what the specific error message is?

    You can't possibly have type name collisions unless there is something
    you aren't telling us. The default ASP.NET batch compilation will
    generate an assembly for each directory. The assemblies will both have
    names like App_Web_*.dll. Even then, the CodeFile classes should have
    names like Folder1_Default and Folder2_Default.

    Are you using aspnet_merge.exe, perhaps?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/
     
    Scott Allen, Jan 28, 2006
    #18
  19. That demonstrates that you ask me questions without trying.

    Just do what I described in VS2005, (1.5 minutes of work) and you'll get the
    error.
    I've also opened a Bug Reuest at Microsoft, and they have reproduced the
    problem.

    Have you got VS2005?

    "Scott Allen" wrote:

    > On Sat, 28 Jan 2006 00:59:26 -0800, abunet <> wrote:
    >
    > >
    > >- To reproduce the problem in VS2005, just add 2 folders to a web site, and
    > >then 2 web forms, each aspx in one folder, and name them default.apsx. You'll
    > >get an error.
    > >

    >
    > Can you tell us what the specific error message is?
    >
    > You can't possibly have type name collisions unless there is something
    > you aren't telling us. The default ASP.NET batch compilation will
    > generate an assembly for each directory. The assemblies will both have
    > names like App_Web_*.dll. Even then, the CodeFile classes should have
    > names like Folder1_Default and Folder2_Default.
    >
    > Are you using aspnet_merge.exe, perhaps?
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
     
    =?Utf-8?B?YWJ1bmV0?=, Jan 29, 2006
    #19
  20. Scott Allen Guest

    On Sun, 29 Jan 2006 01:38:27 -0800, abunet <> wrote:

    >That demonstrates that you ask me questions without trying.
    >
    >Just do what I described in VS2005, (1.5 minutes of work) and you'll get the
    >error.
    >I've also opened a Bug Reuest at Microsoft, and they have reproduced the
    >problem.
    >
    >Have you got VS2005?
    >


    Yes, VS 2005 RTM.

    I have no problems putting two default.aspx web forms into two
    different directories. Please elaborate on the problem you see in this
    scenario.

    I do have a problem putting two .xsd files with the same name into two
    sub-directories of App_Code. You can put the generated DataSets into
    different namespaces by:

    1. Using a file naming convention.

    2. Use a class library instead of App_Code.

    As an example of #1, name one file Foo.DataSet1.xsd and the other
    Bar.DataSet1.xsd. The runtime will generate a DataSet1 class in a Foo
    namespace, and a DataSet1 class in a Bar namespace.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/
     
    Scott Allen, Jan 30, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ad
    Replies:
    5
    Views:
    1,589
  2. jdn
    Replies:
    8
    Views:
    472
  3. rockdale
    Replies:
    1
    Views:
    617
    Juan T. Llibre
    Aug 23, 2006
  4. Bit Byte
    Replies:
    16
    Views:
    802
    clintonG
    Feb 5, 2007
  5. jonny
    Replies:
    1
    Views:
    468
    Michael Nemtsev
    Oct 6, 2007
Loading...

Share This Page