How To Use Nested Namespace [Help]

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tiraman

    How To Use Nested Namespace [Help]

    Hi ,

    I would like to use nested namespace .

    I have 3 namespace as dll's :
    Namespace A
    Namespace B
    Namespace C

    And i want to have some namespace that contain them all , some thing like

    Namespace MyComp.A.B.C
    Or
    Namespace MyComp.A.B or Namespace B.C And so on ...

    (e.g ---> System.Data)

    please help


  • Scott M.

    #2
    Re: How To Use Nested Namespace [Help]

    By default, your project name becomes the "root namespace" of your assembly.
    If you are using VS.NET, just right click on the project in the Solution
    Explorer and you'll see an option to change the name of the Root Namespace
    there.

    To create sub-namespaces, do exactly what you wrote down below (remembering
    to end each namespace):

    Namespace A
    Namespace B
    Namespace C

    Public Class Foo


    End Class

    End Namespace
    End Namespace
    End Namespace

    All 3 namespaces are part of the root namespace (project name by default or
    you change in project properties) and Foo is in the namespace:

    RootNamespace.A .B.C.Foo





    "Tiraman" <tiraman@netvis ion.net.il> wrote in message
    news:eUn0fABHEH A.3528@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Hi ,
    >
    > I would like to use nested namespace .
    >
    > I have 3 namespace as dll's :
    > Namespace A
    > Namespace B
    > Namespace C
    >
    > And i want to have some namespace that contain them all , some thing like
    >
    > Namespace MyComp.A.B.C
    > Or
    > Namespace MyComp.A.B or Namespace B.C And so on ...
    >
    > (e.g ---> System.Data)
    >
    > please help
    >
    >[/color]


    Comment

    • Scott M.

      #3
      Re: How To Use Nested Namespace [Help]

      By default, your project name becomes the "root namespace" of your assembly.
      If you are using VS.NET, just right click on the project in the Solution
      Explorer and you'll see an option to change the name of the Root Namespace
      there.

      To create sub-namespaces, do exactly what you wrote down below (remembering
      to end each namespace):

      Namespace A
      Namespace B
      Namespace C

      Public Class Foo


      End Class

      End Namespace
      End Namespace
      End Namespace

      All 3 namespaces are part of the root namespace (project name by default or
      you change in project properties) and Foo is in the namespace:

      RootNamespace.A .B.C.Foo





      "Tiraman" <tiraman@netvis ion.net.il> wrote in message
      news:eUn0fABHEH A.3528@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Hi ,
      >
      > I would like to use nested namespace .
      >
      > I have 3 namespace as dll's :
      > Namespace A
      > Namespace B
      > Namespace C
      >
      > And i want to have some namespace that contain them all , some thing like
      >
      > Namespace MyComp.A.B.C
      > Or
      > Namespace MyComp.A.B or Namespace B.C And so on ...
      >
      > (e.g ---> System.Data)
      >
      > please help
      >
      >[/color]


      Comment

      • Martin Robins

        #4
        Re: How To Use Nested Namespace [Help]

        namespace MyCompany.A.B.C {
        class Foo {
        }
        }

        Gives a class called MyCompany.A.B.C .Foo


        "Tiraman" <tiraman@netvis ion.net.il> wrote in message
        news:eUn0fABHEH A.3528@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Hi ,
        >
        > I would like to use nested namespace .
        >
        > I have 3 namespace as dll's :
        > Namespace A
        > Namespace B
        > Namespace C
        >
        > And i want to have some namespace that contain them all , some thing like
        >
        > Namespace MyComp.A.B.C
        > Or
        > Namespace MyComp.A.B or Namespace B.C And so on ...
        >
        > (e.g ---> System.Data)
        >
        > please help
        >
        >[/color]


        Comment

        • Martin Robins

          #5
          Re: How To Use Nested Namespace [Help]

          namespace MyCompany.A.B.C {
          class Foo {
          }
          }

          Gives a class called MyCompany.A.B.C .Foo


          "Tiraman" <tiraman@netvis ion.net.il> wrote in message
          news:eUn0fABHEH A.3528@TK2MSFTN GP09.phx.gbl...[color=blue]
          > Hi ,
          >
          > I would like to use nested namespace .
          >
          > I have 3 namespace as dll's :
          > Namespace A
          > Namespace B
          > Namespace C
          >
          > And i want to have some namespace that contain them all , some thing like
          >
          > Namespace MyComp.A.B.C
          > Or
          > Namespace MyComp.A.B or Namespace B.C And so on ...
          >
          > (e.g ---> System.Data)
          >
          > please help
          >
          >[/color]


          Comment

          • Armin Zingler

            #6
            Re: How To Use Nested Namespace [Help]

            "Martin Robins" <martin - robins @ ntlworld dot com> schrieb[color=blue]
            > namespace MyCompany.A.B.C {
            > class Foo {
            > }
            > }
            >
            > Gives a class called MyCompany.A.B.C .Foo[/color]

            Not in VB.NET. ;-)


            --
            Armin

            How to quote and why:



            Comment

            • Armin Zingler

              #7
              Re: How To Use Nested Namespace [Help]

              "Martin Robins" <martin - robins @ ntlworld dot com> schrieb[color=blue]
              > namespace MyCompany.A.B.C {
              > class Foo {
              > }
              > }
              >
              > Gives a class called MyCompany.A.B.C .Foo[/color]

              Not in VB.NET. ;-)


              --
              Armin

              How to quote and why:



              Comment

              • Peter Huang

                #8
                RE: How To Use Nested Namespace [Help]

                Hi Tiraman,

                First of all, I would like to confirm my understanding of your issue.
                From your description, I understand that you wants to use a nested
                namespace.
                Have I fully understood you? If there is anything I misunderstood, please
                feel free to let me know.

                I think you may take a look at the two links below.
                Namespace Naming Guidelines

                ml/cpconnamespacen amingguidelines .asp

                Namespace Statement

                vastmnamespace. asp

                Please apply my suggestion above and let me know if it helps resolve your
                problem.


                Best regards,

                Peter Huang
                Microsoft Online Partner Support

                Get Secure! - www.microsoft.com/security
                This posting is provided "AS IS" with no warranties, and confers no rights.

                Comment

                • Peter Huang

                  #9
                  RE: How To Use Nested Namespace [Help]

                  Hi Tiraman,

                  First of all, I would like to confirm my understanding of your issue.
                  From your description, I understand that you wants to use a nested
                  namespace.
                  Have I fully understood you? If there is anything I misunderstood, please
                  feel free to let me know.

                  I think you may take a look at the two links below.
                  Namespace Naming Guidelines

                  ml/cpconnamespacen amingguidelines .asp

                  Namespace Statement

                  vastmnamespace. asp

                  Please apply my suggestion above and let me know if it helps resolve your
                  problem.


                  Best regards,

                  Peter Huang
                  Microsoft Online Partner Support

                  Get Secure! - www.microsoft.com/security
                  This posting is provided "AS IS" with no warranties, and confers no rights.

                  Comment

                  • Tiraman

                    #10
                    Re: How To Use Nested Namespace [Help]

                    Ok ,

                    I found where I can change the Root Namespace which is good but let me
                    describe you what I want to do .

                    lets say that I have a company name Comp and we have 3 Departments (A,B,C)

                    now each department working on some namespace and on its class's and I want
                    to make one namespace

                    that will include them all (not the code !!! just the call or the import to
                    those namespace's ) and if we will open a new department tomorrow

                    I want the ability to add a call or include or import to the new department
                    (namespace) into the root namespace

                    so every one that use this root namespace will be able to use other public
                    functions .

                    10x


                    "Scott M." <s-mar@BADSPAMsnet .net> wrote in message
                    news:u6VHHGBHEH A.3032@TK2MSFTN GP09.phx.gbl...[color=blue]
                    > By default, your project name becomes the "root namespace" of your[/color]
                    assembly.[color=blue]
                    > If you are using VS.NET, just right click on the project in the Solution
                    > Explorer and you'll see an option to change the name of the Root Namespace
                    > there.
                    >
                    > To create sub-namespaces, do exactly what you wrote down below[/color]
                    (remembering[color=blue]
                    > to end each namespace):
                    >
                    > Namespace A
                    > Namespace B
                    > Namespace C
                    >
                    > Public Class Foo
                    >
                    >
                    > End Class
                    >
                    > End Namespace
                    > End Namespace
                    > End Namespace
                    >
                    > All 3 namespaces are part of the root namespace (project name by default[/color]
                    or[color=blue]
                    > you change in project properties) and Foo is in the namespace:
                    >
                    > RootNamespace.A .B.C.Foo
                    >
                    >
                    >
                    >
                    >
                    > "Tiraman" <tiraman@netvis ion.net.il> wrote in message
                    > news:eUn0fABHEH A.3528@TK2MSFTN GP09.phx.gbl...[color=green]
                    > > Hi ,
                    > >
                    > > I would like to use nested namespace .
                    > >
                    > > I have 3 namespace as dll's :
                    > > Namespace A
                    > > Namespace B
                    > > Namespace C
                    > >
                    > > And i want to have some namespace that contain them all , some thing[/color][/color]
                    like[color=blue][color=green]
                    > >
                    > > Namespace MyComp.A.B.C
                    > > Or
                    > > Namespace MyComp.A.B or Namespace B.C And so on ...
                    > >
                    > > (e.g ---> System.Data)
                    > >
                    > > please help
                    > >
                    > >[/color]
                    >
                    >[/color]


                    Comment

                    • Tiraman

                      #11
                      Re: How To Use Nested Namespace [Help]

                      Ok ,

                      I found where I can change the Root Namespace which is good but let me
                      describe you what I want to do .

                      lets say that I have a company name Comp and we have 3 Departments (A,B,C)

                      now each department working on some namespace and on its class's and I want
                      to make one namespace

                      that will include them all (not the code !!! just the call or the import to
                      those namespace's ) and if we will open a new department tomorrow

                      I want the ability to add a call or include or import to the new department
                      (namespace) into the root namespace

                      so every one that use this root namespace will be able to use other public
                      functions .

                      10x


                      "Scott M." <s-mar@BADSPAMsnet .net> wrote in message
                      news:u6VHHGBHEH A.3032@TK2MSFTN GP09.phx.gbl...[color=blue]
                      > By default, your project name becomes the "root namespace" of your[/color]
                      assembly.[color=blue]
                      > If you are using VS.NET, just right click on the project in the Solution
                      > Explorer and you'll see an option to change the name of the Root Namespace
                      > there.
                      >
                      > To create sub-namespaces, do exactly what you wrote down below[/color]
                      (remembering[color=blue]
                      > to end each namespace):
                      >
                      > Namespace A
                      > Namespace B
                      > Namespace C
                      >
                      > Public Class Foo
                      >
                      >
                      > End Class
                      >
                      > End Namespace
                      > End Namespace
                      > End Namespace
                      >
                      > All 3 namespaces are part of the root namespace (project name by default[/color]
                      or[color=blue]
                      > you change in project properties) and Foo is in the namespace:
                      >
                      > RootNamespace.A .B.C.Foo
                      >
                      >
                      >
                      >
                      >
                      > "Tiraman" <tiraman@netvis ion.net.il> wrote in message
                      > news:eUn0fABHEH A.3528@TK2MSFTN GP09.phx.gbl...[color=green]
                      > > Hi ,
                      > >
                      > > I would like to use nested namespace .
                      > >
                      > > I have 3 namespace as dll's :
                      > > Namespace A
                      > > Namespace B
                      > > Namespace C
                      > >
                      > > And i want to have some namespace that contain them all , some thing[/color][/color]
                      like[color=blue][color=green]
                      > >
                      > > Namespace MyComp.A.B.C
                      > > Or
                      > > Namespace MyComp.A.B or Namespace B.C And so on ...
                      > >
                      > > (e.g ---> System.Data)
                      > >
                      > > please help
                      > >
                      > >[/color]
                      >
                      >[/color]


                      Comment

                      • Tiraman

                        #12
                        Re: How To Use Nested Namespace [Help]

                        Hi Peter ,

                        your suggestion was good and the articles helped me :-)

                        let me ask you one more thing please ,

                        I created a dll name A.B.C.dll and i put that dll under c:\MyDlls\

                        The Dll Namespace Is A.B.C and i have a class name Test under that dll .

                        when i m doing this in my aspx file
                        Import Namespace="A.B. C"
                        And Than
                        Dim myParam As New Test

                        I m getting an error that my Test is not defined

                        But when i m moving the dll into the bin folder under my project every thing
                        comes in order :-)

                        i will be happy to know how to put all of my dll's in one place and use them
                        from my projects with out moving them into the bin folder .

                        bye and 10x for your help :-)



                        ""Peter Huang"" <v-phuang@online.m icrosoft.com> wrote in message
                        news:2P0fffGHEH A.3568@cpmsftng xa06.phx.gbl...[color=blue]
                        > Hi Tiraman,
                        >
                        > First of all, I would like to confirm my understanding of your issue.
                        > From your description, I understand that you wants to use a nested
                        > namespace.
                        > Have I fully understood you? If there is anything I misunderstood, please
                        > feel free to let me know.
                        >
                        > I think you may take a look at the two links below.
                        > Namespace Naming Guidelines
                        >[/color]
                        http://msdn.microsoft.com/library/de...us/cpgenref/ht[color=blue]
                        > ml/cpconnamespacen amingguidelines .asp
                        >
                        > Namespace Statement
                        >[/color]
                        http://msdn.microsoft.com/library/de...us/vblr7/html/[color=blue]
                        > vastmnamespace. asp
                        >
                        > Please apply my suggestion above and let me know if it helps resolve your
                        > problem.
                        >
                        >
                        > Best regards,
                        >
                        > Peter Huang
                        > Microsoft Online Partner Support
                        >
                        > Get Secure! - www.microsoft.com/security
                        > This posting is provided "AS IS" with no warranties, and confers no[/color]
                        rights.[color=blue]
                        >[/color]


                        Comment

                        • Tiraman

                          #13
                          Re: How To Use Nested Namespace [Help]

                          Hi Peter ,

                          your suggestion was good and the articles helped me :-)

                          let me ask you one more thing please ,

                          I created a dll name A.B.C.dll and i put that dll under c:\MyDlls\

                          The Dll Namespace Is A.B.C and i have a class name Test under that dll .

                          when i m doing this in my aspx file
                          Import Namespace="A.B. C"
                          And Than
                          Dim myParam As New Test

                          I m getting an error that my Test is not defined

                          But when i m moving the dll into the bin folder under my project every thing
                          comes in order :-)

                          i will be happy to know how to put all of my dll's in one place and use them
                          from my projects with out moving them into the bin folder .

                          bye and 10x for your help :-)



                          ""Peter Huang"" <v-phuang@online.m icrosoft.com> wrote in message
                          news:2P0fffGHEH A.3568@cpmsftng xa06.phx.gbl...[color=blue]
                          > Hi Tiraman,
                          >
                          > First of all, I would like to confirm my understanding of your issue.
                          > From your description, I understand that you wants to use a nested
                          > namespace.
                          > Have I fully understood you? If there is anything I misunderstood, please
                          > feel free to let me know.
                          >
                          > I think you may take a look at the two links below.
                          > Namespace Naming Guidelines
                          >[/color]
                          http://msdn.microsoft.com/library/de...us/cpgenref/ht[color=blue]
                          > ml/cpconnamespacen amingguidelines .asp
                          >
                          > Namespace Statement
                          >[/color]
                          http://msdn.microsoft.com/library/de...us/vblr7/html/[color=blue]
                          > vastmnamespace. asp
                          >
                          > Please apply my suggestion above and let me know if it helps resolve your
                          > problem.
                          >
                          >
                          > Best regards,
                          >
                          > Peter Huang
                          > Microsoft Online Partner Support
                          >
                          > Get Secure! - www.microsoft.com/security
                          > This posting is provided "AS IS" with no warranties, and confers no[/color]
                          rights.[color=blue]
                          >[/color]


                          Comment

                          • Peter Huang

                            #14
                            Re: How To Use Nested Namespace [Help]

                            Hi Tiraman,

                            Thank you for your quick response.
                            From my understanding, the error will be orrcur in the runtime, am I right?

                            As I reply in another post in this newsgroup titled "Namespace Question",
                            this may be caused by that the Test.Dll is not in the three place the
                            ASP.NET application will search the assembly.
                            (1.GAC 2.bin 3.codebase)

                            You may refer to that issue for detailed information.

                            Best regards,

                            Peter Huang
                            Microsoft Online Partner Support

                            Get Secure! - www.microsoft.com/security
                            This posting is provided "AS IS" with no warranties, and confers no rights.

                            Comment

                            • Peter Huang

                              #15
                              Re: How To Use Nested Namespace [Help]

                              Hi Tiraman,

                              Thank you for your quick response.
                              From my understanding, the error will be orrcur in the runtime, am I right?

                              As I reply in another post in this newsgroup titled "Namespace Question",
                              this may be caused by that the Test.Dll is not in the three place the
                              ASP.NET application will search the assembly.
                              (1.GAC 2.bin 3.codebase)

                              You may refer to that issue for detailed information.

                              Best regards,

                              Peter Huang
                              Microsoft Online Partner Support

                              Get Secure! - www.microsoft.com/security
                              This posting is provided "AS IS" with no warranties, and confers no rights.

                              Comment

                              Working...