none
Namespace: To name or not to name!! RRS feed

  • Question

  • Namespace one
        Public Class test
            Public Property t As String
        End Class
    End Namespace
    
    Namespace two
        Module Module1
    
            Public Enum Days
                Sunday
                Monday
                Tuesday
                Wednesday
            End Enum
    
            Sub Main()
                Console.WriteLine($"{"Data Type",-20}{"Result",-40}")
                Console.WriteLine($"{"---------",-20}{"------",-40}")
                Console.WriteLine($"{"ENUM Member Sunday",-20}{Days.Sunday.GetType(),-40}:")
                Console.WriteLine($"{"ENUM DAYS",-20}{GetType(Days)}")
                Console.WriteLine($"{"Class TEST",-20}{GetType(one.test)}")
                Console.ReadLine()
            End Sub
    
        End Module
    End Namespace

    for the above code I get the following error:

    "

    I see that the error is not happening when I remove the "namespace two", i.e. if the module 1 is made the outermost container . So where am I going wrong with the "namespace two" statement?


    Sougata Ghosh

    Saturday, November 24, 2018 8:32 AM

Answers

  • Hello,

    You need to change the startup object in project properties.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by sougata12 Saturday, November 24, 2018 9:32 AM
    Saturday, November 24, 2018 9:23 AM
    Moderator

All replies

  • Hello,

    You need to change the startup object in project properties.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by sougata12 Saturday, November 24, 2018 9:32 AM
    Saturday, November 24, 2018 9:23 AM
    Moderator
  • thank you

    Sougata Ghosh

    Saturday, November 24, 2018 9:33 AM